Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlPagerLinkButton.cs / 1305376 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InputScope.cs
- StyleReferenceConverter.cs
- DataViewSetting.cs
- BamlMapTable.cs
- DropDownHolder.cs
- PathStreamGeometryContext.cs
- BuildDependencySet.cs
- XXXOnTypeBuilderInstantiation.cs
- XmlSchemaRedefine.cs
- BaseParser.cs
- VerticalAlignConverter.cs
- ComponentRenameEvent.cs
- OperationGenerator.cs
- UnauthorizedAccessException.cs
- CodeSnippetTypeMember.cs
- __TransparentProxy.cs
- StylusTip.cs
- KeyValueConfigurationElement.cs
- KerberosTokenFactoryCredential.cs
- SkewTransform.cs
- CellTreeNodeVisitors.cs
- FormatSettings.cs
- DataGridViewCellValidatingEventArgs.cs
- BaseDataList.cs
- SqlBuilder.cs
- Facet.cs
- ExecutedRoutedEventArgs.cs
- WindowsFormsLinkLabel.cs
- ElementMarkupObject.cs
- OperationParameterInfo.cs
- ProcessHostFactoryHelper.cs
- HwndSourceKeyboardInputSite.cs
- GridLength.cs
- PropertyGroupDescription.cs
- Grid.cs
- TextEditorParagraphs.cs
- Geometry3D.cs
- DeflateStream.cs
- EventProxy.cs
- XsdValidatingReader.cs
- XmlChildNodes.cs
- XmlSchemaObject.cs
- DataGridViewCellCancelEventArgs.cs
- InternalResources.cs
- DefaultHttpHandler.cs
- FactoryId.cs
- EpmContentDeSerializer.cs
- SynchronizationContext.cs
- DocumentSequence.cs
- ConfigXmlComment.cs
- CodeIndexerExpression.cs
- ImageAttributes.cs
- ProjectionPathBuilder.cs
- EnumMemberAttribute.cs
- XmlSchema.cs
- CreateUserErrorEventArgs.cs
- TypefaceMetricsCache.cs
- DataGridViewTextBoxColumn.cs
- MaterialGroup.cs
- HttpResponseWrapper.cs
- SequenceNumber.cs
- TextureBrush.cs
- ScalarType.cs
- InkSerializer.cs
- GridViewRowCollection.cs
- Column.cs
- StackBuilderSink.cs
- BatchStream.cs
- SynchronizationContext.cs
- HybridCollection.cs
- CertificateManager.cs
- Header.cs
- FeatureSupport.cs
- FrameSecurityDescriptor.cs
- DataSourceCacheDurationConverter.cs
- RectangleConverter.cs
- CroppedBitmap.cs
- StylusPoint.cs
- Message.cs
- MissingFieldException.cs
- EmbossBitmapEffect.cs
- IisTraceListener.cs
- XmlDataContract.cs
- PrePrepareMethodAttribute.cs
- FunctionImportElement.cs
- WindowsButton.cs
- GridViewColumnCollection.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DocumentGridContextMenu.cs
- MetadataItem_Static.cs
- SspiSecurityTokenProvider.cs
- CacheRequest.cs
- MenuTracker.cs
- ByteStreamMessageEncoder.cs
- control.ime.cs
- Viewport3DAutomationPeer.cs
- DiagnosticTrace.cs
- CodeSnippetStatement.cs
- SwitchElementsCollection.cs
- FormParameter.cs