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
- MenuScrollingVisibilityConverter.cs
- EntityCollection.cs
- LinqDataSourceInsertEventArgs.cs
- CommandField.cs
- ConnectionInterfaceCollection.cs
- IteratorDescriptor.cs
- DefaultPrintController.cs
- UInt64.cs
- PeerNameRecordCollection.cs
- XmlResolver.cs
- TableLayoutPanelCodeDomSerializer.cs
- TableLayout.cs
- StatusBar.cs
- SatelliteContractVersionAttribute.cs
- FontCacheUtil.cs
- cookie.cs
- PeerTransportCredentialType.cs
- ImportContext.cs
- DynamicValidatorEventArgs.cs
- ProcessHostServerConfig.cs
- processwaithandle.cs
- DynamicDataRoute.cs
- MetabaseServerConfig.cs
- StreamReader.cs
- TextEncodedRawTextWriter.cs
- updateconfighost.cs
- PriorityBinding.cs
- RoutedEvent.cs
- BitFlagsGenerator.cs
- SymbolUsageManager.cs
- DataGridBoolColumn.cs
- ErrorTableItemStyle.cs
- DataExpression.cs
- OrderedHashRepartitionStream.cs
- BoundColumn.cs
- MergeLocalizationDirectives.cs
- NamedPermissionSet.cs
- ProfileManager.cs
- EdmProviderManifest.cs
- MultiBindingExpression.cs
- SourceChangedEventArgs.cs
- SchemaElementDecl.cs
- EmptyEnumerator.cs
- LookupBindingPropertiesAttribute.cs
- localization.cs
- QilXmlReader.cs
- CodeIndexerExpression.cs
- TableLayoutSettingsTypeConverter.cs
- RuntimeUtils.cs
- ExitEventArgs.cs
- WebBaseEventKeyComparer.cs
- SamlSubject.cs
- TemplateContentLoader.cs
- GridViewColumn.cs
- WindowsFormsHelpers.cs
- StructuredCompositeActivityDesigner.cs
- CssStyleCollection.cs
- BinaryConverter.cs
- PeerSecurityHelpers.cs
- ConstrainedDataObject.cs
- ClientOptions.cs
- GridViewUpdatedEventArgs.cs
- TypeUnloadedException.cs
- DefaultPerformanceCounters.cs
- ChannelAcceptor.cs
- ValidationError.cs
- XamlSerializationHelper.cs
- DesignerHelpers.cs
- ImageAttributes.cs
- SqlNamer.cs
- ConfigWriter.cs
- InternalSafeNativeMethods.cs
- ServerProtocol.cs
- EntityTypeBase.cs
- RoleBoolean.cs
- ListItemCollection.cs
- CodeGenerator.cs
- InputLangChangeEvent.cs
- EventTask.cs
- DoubleConverter.cs
- TableCellCollection.cs
- PenCursorManager.cs
- IsolatedStorageFilePermission.cs
- SessionStateItemCollection.cs
- PageAsyncTask.cs
- CapiSymmetricAlgorithm.cs
- FrameworkElementAutomationPeer.cs
- ScaleTransform3D.cs
- FormViewPagerRow.cs
- CodeRemoveEventStatement.cs
- ResourcePermissionBaseEntry.cs
- PerspectiveCamera.cs
- mactripleDES.cs
- RightsManagementPermission.cs
- BitmapEffectDrawing.cs
- BaseTemplateCodeDomTreeGenerator.cs
- Array.cs
- BordersPage.cs
- ContextProperty.cs
- IdentityValidationException.cs