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
- ClientFormsIdentity.cs
- LinkDescriptor.cs
- arc.cs
- RotateTransform.cs
- ToolStripPanelCell.cs
- TdsParserStateObject.cs
- ChannelServices.cs
- SqlClientWrapperSmiStreamChars.cs
- XmlSchemaNotation.cs
- RIPEMD160.cs
- AppDomainUnloadedException.cs
- ElementUtil.cs
- MonitoringDescriptionAttribute.cs
- Byte.cs
- QueuePathEditor.cs
- MSAAWinEventWrap.cs
- SoapFormatExtensions.cs
- StructuredProperty.cs
- ThrowHelper.cs
- WebPartDescription.cs
- CqlParserHelpers.cs
- InternalBufferOverflowException.cs
- PathGeometry.cs
- WinCategoryAttribute.cs
- ViewManager.cs
- InlinedAggregationOperator.cs
- StringResourceManager.cs
- DiagnosticTraceSource.cs
- DataSourceXmlSerializer.cs
- PropertyInformation.cs
- QueryReaderSettings.cs
- ChangeToolStripParentVerb.cs
- BitmapEffect.cs
- EncodingInfo.cs
- TabControlCancelEvent.cs
- AnonymousIdentificationSection.cs
- SchemaElementLookUpTable.cs
- SystemIcmpV6Statistics.cs
- UpdatableGenericsFeature.cs
- _UriSyntax.cs
- ResourceDisplayNameAttribute.cs
- OrderedDictionary.cs
- RC2CryptoServiceProvider.cs
- XmlElementCollection.cs
- GenericAuthenticationEventArgs.cs
- RelationalExpressions.cs
- ExpressionLexer.cs
- PropertyBuilder.cs
- EmptyImpersonationContext.cs
- SortFieldComparer.cs
- IgnoreSectionHandler.cs
- FtpWebResponse.cs
- ObjectComplexPropertyMapping.cs
- Component.cs
- DefaultExpression.cs
- DataGridRow.cs
- DataBoundControl.cs
- MergeFilterQuery.cs
- DropDownList.cs
- Sequence.cs
- HttpFileCollection.cs
- TypefaceMetricsCache.cs
- TableRow.cs
- MessageContractAttribute.cs
- Int32CollectionConverter.cs
- ScriptIgnoreAttribute.cs
- WindowsScrollBar.cs
- EventQueueState.cs
- HtmlControl.cs
- BitStack.cs
- Registry.cs
- LayoutEditorPart.cs
- Brush.cs
- DataServiceStreamResponse.cs
- ItemsControl.cs
- TemplateBindingExtensionConverter.cs
- ListViewEditEventArgs.cs
- CheckableControlBaseAdapter.cs
- SerializationSectionGroup.cs
- WebServiceParameterData.cs
- XmlValueConverter.cs
- LocalBuilder.cs
- StructuredType.cs
- _HTTPDateParse.cs
- NullRuntimeConfig.cs
- StandardBindingElementCollection.cs
- CatalogZoneAutoFormat.cs
- PropertyKey.cs
- XPathDocumentIterator.cs
- NumericUpDownAccelerationCollection.cs
- RuntimeHelpers.cs
- GroupStyle.cs
- ToolBarOverflowPanel.cs
- QueryCursorEventArgs.cs
- ClosureBinding.cs
- MenuScrollingVisibilityConverter.cs
- ClientConfigurationSystem.cs
- DataGridHelper.cs
- EdmError.cs
- Attributes.cs