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
- Int32EqualityComparer.cs
- CookieHandler.cs
- EntryWrittenEventArgs.cs
- BigInt.cs
- RotateTransform.cs
- HtmlElementCollection.cs
- StandardCommands.cs
- ExpressionBuilder.cs
- InsufficientExecutionStackException.cs
- ReflectPropertyDescriptor.cs
- TextServicesCompartment.cs
- DecimalAnimationBase.cs
- SafeCertificateStore.cs
- DateTimeConverter2.cs
- BindingCollection.cs
- AmbientLight.cs
- State.cs
- PropertyTabChangedEvent.cs
- IHttpResponseInternal.cs
- DescendantOverDescendantQuery.cs
- InteropBitmapSource.cs
- BitmapDownload.cs
- HttpConfigurationSystem.cs
- BindValidationContext.cs
- GifBitmapDecoder.cs
- ExitEventArgs.cs
- LocalValueEnumerator.cs
- BrushConverter.cs
- XmlSignificantWhitespace.cs
- SlotInfo.cs
- LZCodec.cs
- CollectionViewProxy.cs
- PathSegmentCollection.cs
- CharacterBufferReference.cs
- WeakEventTable.cs
- XmlAttributes.cs
- EntityKeyElement.cs
- TextEditorCopyPaste.cs
- TextRange.cs
- XmlEncoding.cs
- CellIdBoolean.cs
- NodeLabelEditEvent.cs
- X509RecipientCertificateServiceElement.cs
- HttpModuleAction.cs
- DataContractAttribute.cs
- Calendar.cs
- ErrorWebPart.cs
- keycontainerpermission.cs
- DBAsyncResult.cs
- WebServiceAttribute.cs
- ValidationPropertyAttribute.cs
- X509WindowsSecurityToken.cs
- ScheduleChanges.cs
- DetailsViewCommandEventArgs.cs
- DataPagerFieldCollection.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Line.cs
- InlineObject.cs
- Control.cs
- MembershipPasswordException.cs
- PrintPreviewDialog.cs
- FormViewUpdatedEventArgs.cs
- StatusBarItem.cs
- MasterPageBuildProvider.cs
- DotExpr.cs
- InputReport.cs
- DetailsViewDeletedEventArgs.cs
- MenuAdapter.cs
- SafeViewOfFileHandle.cs
- WindowsHyperlink.cs
- ToolboxItemSnapLineBehavior.cs
- FixUpCollection.cs
- GcSettings.cs
- EditorAttributeInfo.cs
- ButtonFlatAdapter.cs
- EventDriven.cs
- PersonalizationDictionary.cs
- MenuItemStyleCollectionEditor.cs
- LogoValidationException.cs
- FullTextState.cs
- StreamResourceInfo.cs
- DataGridTableCollection.cs
- BuildProvider.cs
- TextServicesProperty.cs
- RuntimeHandles.cs
- PlatformCulture.cs
- ReflectEventDescriptor.cs
- SystemIPv6InterfaceProperties.cs
- ShaderEffect.cs
- XmlSchemaIdentityConstraint.cs
- TextBox.cs
- DBSqlParserTableCollection.cs
- TemplateKeyConverter.cs
- IIS7WorkerRequest.cs
- PointAnimationUsingKeyFrames.cs
- NavigationPropertyEmitter.cs
- StoreItemCollection.Loader.cs
- KnowledgeBase.cs
- BrushValueSerializer.cs
- WebResourceAttribute.cs