Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / IDReferencePropertyAttribute.cs / 1 / IDReferencePropertyAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System;
using System.ComponentModel;
using System.Security.Permissions;
///
/// An IDReferencePropertyAttribute metadata attribute can be applied to string properties
/// that contain ID references.
/// This can be used to identify ID reference properties which allows design-time functionality
/// to do interesting things with the property values.
///
[AttributeUsage(AttributeTargets.Property)]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class IDReferencePropertyAttribute : Attribute {
private Type _referencedControlType;
///
///
public IDReferencePropertyAttribute() : this(typeof(Control)) {
}
///
/// Used to mark a property as an ID reference. In addition, the type of controls
/// can be specified.
///
public IDReferencePropertyAttribute(Type referencedControlType) {
_referencedControlType = referencedControlType;
}
///
/// The types of controls allowed by the property.
///
public Type ReferencedControlType {
get {
return _referencedControlType;
}
}
///
public override int GetHashCode() {
return ((ReferencedControlType != null) ? ReferencedControlType.GetHashCode() : 0);
}
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
IDReferencePropertyAttribute other = obj as IDReferencePropertyAttribute;
if (other != null) {
return (ReferencedControlType == other.ReferencedControlType);
}
return false;
}
}
}
// 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 {
using System;
using System.ComponentModel;
using System.Security.Permissions;
///
/// An IDReferencePropertyAttribute metadata attribute can be applied to string properties
/// that contain ID references.
/// This can be used to identify ID reference properties which allows design-time functionality
/// to do interesting things with the property values.
///
[AttributeUsage(AttributeTargets.Property)]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class IDReferencePropertyAttribute : Attribute {
private Type _referencedControlType;
///
///
public IDReferencePropertyAttribute() : this(typeof(Control)) {
}
///
/// Used to mark a property as an ID reference. In addition, the type of controls
/// can be specified.
///
public IDReferencePropertyAttribute(Type referencedControlType) {
_referencedControlType = referencedControlType;
}
///
/// The types of controls allowed by the property.
///
public Type ReferencedControlType {
get {
return _referencedControlType;
}
}
///
public override int GetHashCode() {
return ((ReferencedControlType != null) ? ReferencedControlType.GetHashCode() : 0);
}
///
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
IDReferencePropertyAttribute other = obj as IDReferencePropertyAttribute;
if (other != null) {
return (ReferencedControlType == other.ReferencedControlType);
}
return false;
}
}
}
// 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
- DetailsViewUpdateEventArgs.cs
- MemoryStream.cs
- SettingsProperty.cs
- SecurityContext.cs
- Update.cs
- ClientSideQueueItem.cs
- WebServiceData.cs
- DataViewManagerListItemTypeDescriptor.cs
- WithStatement.cs
- ValueTypeFixupInfo.cs
- LinqDataSourceContextEventArgs.cs
- HwndKeyboardInputProvider.cs
- DefaultMemberAttribute.cs
- BindingOperations.cs
- ClonableStack.cs
- ConnectionStringEditor.cs
- HMACRIPEMD160.cs
- ConfigurationException.cs
- DataService.cs
- UInt16Converter.cs
- HeaderedItemsControl.cs
- NamespaceList.cs
- SegmentInfo.cs
- ToolboxItem.cs
- XmlArrayAttribute.cs
- NumberSubstitution.cs
- MessageProperties.cs
- BookmarkNameHelper.cs
- InternalException.cs
- CFStream.cs
- _DynamicWinsockMethods.cs
- ButtonFlatAdapter.cs
- SslStream.cs
- FixedSOMTableCell.cs
- EndpointAddress.cs
- TemplateContent.cs
- AssemblyBuilder.cs
- QilReference.cs
- ObjectListFieldCollection.cs
- Win32MouseDevice.cs
- ToolbarAUtomationPeer.cs
- CancellationHandler.cs
- CapabilitiesSection.cs
- __Error.cs
- DocumentGridContextMenu.cs
- DetailsViewRowCollection.cs
- WebErrorHandler.cs
- ChtmlTextWriter.cs
- FirstQueryOperator.cs
- ObjectSpanRewriter.cs
- ValidatorUtils.cs
- InputLangChangeRequestEvent.cs
- SQLChars.cs
- Transform3D.cs
- ConfigurationValues.cs
- DurableErrorHandler.cs
- SuppressMessageAttribute.cs
- ModifierKeysValueSerializer.cs
- QuaternionConverter.cs
- MergePropertyDescriptor.cs
- OutputCacheSection.cs
- AutomationEvent.cs
- WebCategoryAttribute.cs
- TablePattern.cs
- PropertyEmitter.cs
- TextFormatterImp.cs
- TextBreakpoint.cs
- MsmqMessageProperty.cs
- TaskHelper.cs
- BrowserDefinitionCollection.cs
- ColumnPropertiesGroup.cs
- WmlValidationSummaryAdapter.cs
- XmlNavigatorStack.cs
- XmlDataSource.cs
- CacheOutputQuery.cs
- ReferencedType.cs
- StringWriter.cs
- XmlSchemaAttributeGroup.cs
- SafeEventLogWriteHandle.cs
- URL.cs
- ExtentKey.cs
- BaseUriHelper.cs
- Triangle.cs
- FormsAuthenticationCredentials.cs
- HtmlEncodedRawTextWriter.cs
- TemplateBindingExpression.cs
- NamedPipeConnectionPoolSettingsElement.cs
- EdmToObjectNamespaceMap.cs
- BitmapEffectOutputConnector.cs
- ErrorStyle.cs
- OneToOneMappingSerializer.cs
- Verify.cs
- PointAnimationUsingKeyFrames.cs
- PrePrepareMethodAttribute.cs
- PolyLineSegment.cs
- HttpCacheParams.cs
- cookiecollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- InternalsVisibleToAttribute.cs
- ScriptResourceHandler.cs