Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebControls / DataControlPagerLinkButton.cs / 1 / 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
- WindowsScrollBarBits.cs
- QilInvokeEarlyBound.cs
- DbParameterCollectionHelper.cs
- MediaScriptCommandRoutedEventArgs.cs
- ErrorStyle.cs
- DataGridViewLayoutData.cs
- RIPEMD160Managed.cs
- Compiler.cs
- ApplicationCommands.cs
- DrawingContextDrawingContextWalker.cs
- EmptyCollection.cs
- HTMLTagNameToTypeMapper.cs
- ParsedAttributeCollection.cs
- AutomationAttributeInfo.cs
- MethodImplAttribute.cs
- ExpressionBindingCollection.cs
- SyndicationDeserializer.cs
- SqlUserDefinedTypeAttribute.cs
- SortedDictionary.cs
- safemediahandle.cs
- FocusTracker.cs
- ProvidersHelper.cs
- ArrangedElementCollection.cs
- XamlPoint3DCollectionSerializer.cs
- MetadataItem.cs
- PhonemeEventArgs.cs
- XmlWriterSettings.cs
- CustomAssemblyResolver.cs
- NavigationPropertyEmitter.cs
- EventLogPermissionEntry.cs
- HtmlObjectListAdapter.cs
- CompressedStack.cs
- XmlSubtreeReader.cs
- safePerfProviderHandle.cs
- EntityDataSourceDesigner.cs
- Shape.cs
- ImageInfo.cs
- FunctionMappingTranslator.cs
- TriggerBase.cs
- BreakRecordTable.cs
- Condition.cs
- Win32.cs
- CacheMemory.cs
- Quaternion.cs
- ConfigurationStrings.cs
- EntityRecordInfo.cs
- SqlDataSourceView.cs
- LocalBuilder.cs
- VectorAnimationUsingKeyFrames.cs
- ApplicationId.cs
- DataColumnChangeEvent.cs
- ResourceSet.cs
- DynamicILGenerator.cs
- ViewStateChangedEventArgs.cs
- DesignOnlyAttribute.cs
- SoapDocumentServiceAttribute.cs
- PeerNameRecord.cs
- Int32RectValueSerializer.cs
- SqlAggregateChecker.cs
- BeginEvent.cs
- HandlerMappingMemo.cs
- ApplicationContext.cs
- XmlSchemaObject.cs
- PersianCalendar.cs
- EntityDataSourceView.cs
- HandlerBase.cs
- MimeAnyImporter.cs
- SessionSwitchEventArgs.cs
- ReaderWriterLock.cs
- HwndHost.cs
- ExceptionUtility.cs
- DataRelationCollection.cs
- FilterElement.cs
- Accessors.cs
- BaseTemplateParser.cs
- RoleService.cs
- Selector.cs
- QueryableFilterUserControl.cs
- ConfigurationValue.cs
- AnnotationComponentChooser.cs
- TemplateXamlParser.cs
- AppSecurityManager.cs
- EpmContentDeSerializerBase.cs
- FlowLayoutSettings.cs
- QilTypeChecker.cs
- FontDialog.cs
- ListView.cs
- ControlAdapter.cs
- StructureChangedEventArgs.cs
- Config.cs
- AppDomainShutdownMonitor.cs
- localization.cs
- UriParserTemplates.cs
- BmpBitmapEncoder.cs
- CombinedGeometry.cs
- MethodBuilder.cs
- SerTrace.cs
- DefaultMemberAttribute.cs
- SettingsPropertyIsReadOnlyException.cs
- XmlSchemaProviderAttribute.cs