Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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.
//
//-----------------------------------------------------------------------------
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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LayoutManager.cs
- PropertyIDSet.cs
- loginstatus.cs
- SqlReorderer.cs
- Query.cs
- AbstractExpressions.cs
- DataGridCellClipboardEventArgs.cs
- GridLengthConverter.cs
- StreamWithDictionary.cs
- DataColumnMappingCollection.cs
- CustomLineCap.cs
- RelationshipDetailsCollection.cs
- DefaultTypeArgumentAttribute.cs
- UnsettableComboBox.cs
- SystemInfo.cs
- RangeValuePatternIdentifiers.cs
- XslAst.cs
- FormViewInsertEventArgs.cs
- OrderToken.cs
- DebugInfoExpression.cs
- ToolStripDropTargetManager.cs
- FloaterParaClient.cs
- Parsers.cs
- Property.cs
- DiagnosticsConfiguration.cs
- Timeline.cs
- DateRangeEvent.cs
- IriParsingElement.cs
- ComplexTypeEmitter.cs
- OletxDependentTransaction.cs
- EntityContainer.cs
- mansign.cs
- Identity.cs
- Operand.cs
- LiteralControl.cs
- JsonClassDataContract.cs
- SelectedGridItemChangedEvent.cs
- ValueChangedEventManager.cs
- StructuredProperty.cs
- Paragraph.cs
- coordinatorscratchpad.cs
- ArgumentNullException.cs
- versioninfo.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- PlaceHolder.cs
- PackUriHelper.cs
- ScrollItemPattern.cs
- PageStatePersister.cs
- UnsafeNativeMethods.cs
- ControlValuePropertyAttribute.cs
- EditableRegion.cs
- HttpPostedFile.cs
- NavigationEventArgs.cs
- RedirectionProxy.cs
- EntityContainerAssociationSetEnd.cs
- MsmqIntegrationProcessProtocolHandler.cs
- ImportContext.cs
- DecoderBestFitFallback.cs
- objectresult_tresulttype.cs
- ConnectorSelectionGlyph.cs
- MimeFormatter.cs
- WaitHandleCannotBeOpenedException.cs
- SqlRewriteScalarSubqueries.cs
- WebPartExportVerb.cs
- SQLSingleStorage.cs
- ExceptionHandler.cs
- DropShadowBitmapEffect.cs
- DataRelationCollection.cs
- MatrixKeyFrameCollection.cs
- DataRowView.cs
- MiniAssembly.cs
- StylusDownEventArgs.cs
- mda.cs
- SafeViewOfFileHandle.cs
- DomainConstraint.cs
- TextProperties.cs
- XmlSerializationWriter.cs
- Queue.cs
- FilterQueryOptionExpression.cs
- ServerIdentity.cs
- ZipPackage.cs
- ElasticEase.cs
- PostBackOptions.cs
- SmiTypedGetterSetter.cs
- ListViewTableRow.cs
- LinqDataSourceContextData.cs
- NumberEdit.cs
- VirtualPathUtility.cs
- ErrorEventArgs.cs
- RunWorkerCompletedEventArgs.cs
- Base64Encoder.cs
- ZoneMembershipCondition.cs
- ToolStripDropTargetManager.cs
- SafeLibraryHandle.cs
- FilterElement.cs
- ModulesEntry.cs
- WeakReferenceList.cs
- processwaithandle.cs
- NameValueSectionHandler.cs
- TypeElement.cs