Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlPagerLinkButton.cs / 2 / DataControlPagerLinkButton.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of LinkButton used within a DataControl. /// [SupportsEventValidation] internal class DataControlPagerLinkButton : DataControlLinkButton { internal DataControlPagerLinkButton(IPostBackContainer container) : base(container) { } public override bool CausesValidation { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.CannotSetValidationOnPagerButtons)); } } ////// In HTML hyperlinks always use the browser's link color. /// For the DataControl, we want all LinkButtons to honor the ForeColor setting. /// This requires looking up into the control hierarchy to see if either the cell /// or the containing row or table define a ForeColor. /// protected override void SetForeColor() { if (ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FORECOLOR) == false) { Color hyperLinkForeColor; Control control = this; for (int i = 0; i < 6; i++) { control = control.Parent; // pager buttons are usually inside a table that's inside the pager row Debug.Assert(((i == 0) && (control is TableCell)) || ((i == 1) && (control is TableRow)) || ((i == 2) && (control is Table)) || ((i == 3) && (control is TableCell)) || ((i == 4) && (control is TableRow)) || ((i == 5) && (control is Table))); hyperLinkForeColor = ((WebControl)control).ForeColor; if (hyperLinkForeColor != Color.Empty) { ForeColor = hyperLinkForeColor; break; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.Drawing; using System.Web.Util; ////// Derived version of LinkButton used within a DataControl. /// [SupportsEventValidation] internal class DataControlPagerLinkButton : DataControlLinkButton { internal DataControlPagerLinkButton(IPostBackContainer container) : base(container) { } public override bool CausesValidation { get { return false; } set { throw new NotSupportedException(SR.GetString(SR.CannotSetValidationOnPagerButtons)); } } ////// In HTML hyperlinks always use the browser's link color. /// For the DataControl, we want all LinkButtons to honor the ForeColor setting. /// This requires looking up into the control hierarchy to see if either the cell /// or the containing row or table define a ForeColor. /// protected override void SetForeColor() { if (ControlStyle.IsSet(System.Web.UI.WebControls.Style.PROP_FORECOLOR) == false) { Color hyperLinkForeColor; Control control = this; for (int i = 0; i < 6; i++) { control = control.Parent; // pager buttons are usually inside a table that's inside the pager row Debug.Assert(((i == 0) && (control is TableCell)) || ((i == 1) && (control is TableRow)) || ((i == 2) && (control is Table)) || ((i == 3) && (control is TableCell)) || ((i == 4) && (control is TableRow)) || ((i == 5) && (control is Table))); hyperLinkForeColor = ((WebControl)control).ForeColor; if (hyperLinkForeColor != Color.Empty) { ForeColor = hyperLinkForeColor; break; } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PostBackTrigger.cs
- DropDownList.cs
- OracleDateTime.cs
- ImportContext.cs
- WaitHandle.cs
- ComponentEvent.cs
- PriorityQueue.cs
- followingsibling.cs
- DateTimeUtil.cs
- RecordBuilder.cs
- ServiceHost.cs
- WebDisplayNameAttribute.cs
- DeploymentSection.cs
- ValueConversionAttribute.cs
- Tile.cs
- HwndAppCommandInputProvider.cs
- CachedRequestParams.cs
- XmlNode.cs
- XPathSelfQuery.cs
- AppDomain.cs
- VisualBasicSettingsConverter.cs
- ControlAdapter.cs
- FileController.cs
- SQLInt16Storage.cs
- DoubleAnimationBase.cs
- DataTablePropertyDescriptor.cs
- SvcMapFile.cs
- NotFiniteNumberException.cs
- SelectedCellsCollection.cs
- Variable.cs
- HitTestParameters.cs
- ToolbarAUtomationPeer.cs
- SymmetricSecurityBindingElement.cs
- SelectionChangedEventArgs.cs
- HwndTarget.cs
- XmlWriterSettings.cs
- SignedPkcs7.cs
- EFAssociationProvider.cs
- bidPrivateBase.cs
- RectAnimationUsingKeyFrames.cs
- WindowsSolidBrush.cs
- DateTimePickerDesigner.cs
- RadialGradientBrush.cs
- CommandManager.cs
- LogFlushAsyncResult.cs
- FileLevelControlBuilderAttribute.cs
- HtmlMeta.cs
- StringStorage.cs
- RoamingStoreFile.cs
- ProcessModelInfo.cs
- ExceptionUtility.cs
- LabelAutomationPeer.cs
- ServerValidateEventArgs.cs
- X509Certificate.cs
- ImageDrawing.cs
- SystemColorTracker.cs
- BindUriHelper.cs
- ExtentCqlBlock.cs
- DocumentSchemaValidator.cs
- XPathNodePointer.cs
- Variant.cs
- SqlDataAdapter.cs
- SiteIdentityPermission.cs
- XmlWriterSettings.cs
- LineInfo.cs
- FormatConvertedBitmap.cs
- XsltLibrary.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- SQLSingleStorage.cs
- FixedNode.cs
- DBPropSet.cs
- Inline.cs
- XmlElementAttributes.cs
- WindowsButton.cs
- Label.cs
- WebPartZoneBaseDesigner.cs
- DurableTimerExtension.cs
- TwoPhaseCommit.cs
- CodeConstructor.cs
- Thickness.cs
- FlowLayout.cs
- AsnEncodedData.cs
- FrugalMap.cs
- securitycriticaldata.cs
- SortAction.cs
- PassportAuthenticationEventArgs.cs
- List.cs
- PropertyInformationCollection.cs
- SmiEventSink_Default.cs
- ConnectionStringSettings.cs
- ContextMarshalException.cs
- XmlUtf8RawTextWriter.cs
- RealizationDrawingContextWalker.cs
- FileUpload.cs
- GroupBox.cs
- TextTreeText.cs
- ThreadBehavior.cs
- Int64Converter.cs
- ErrorFormatterPage.cs
- SelectionProviderWrapper.cs