Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / ProvidePropertyAttribute.cs / 1305376 / ProvidePropertyAttribute.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.ComponentModel {
using System;
using System.Diagnostics;
using System.Security.Permissions;
///
/// Specifies which methods are extender
/// properties.
///
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public sealed class ProvidePropertyAttribute : Attribute {
private readonly string propertyName;
private readonly string receiverTypeName;
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, Type receiverType) {
this.propertyName = propertyName;
this.receiverTypeName = receiverType.AssemblyQualifiedName;
}
///
/// Initializes a new instance of the class.
///
public ProvidePropertyAttribute(string propertyName, string receiverTypeName) {
this.propertyName = propertyName;
this.receiverTypeName = receiverTypeName;
}
///
///
/// Gets the name of a property that this class provides.
///
///
public string PropertyName {
get {
return propertyName;
}
}
///
///
/// Gets the name of the data type this property can extend
///
///
public string ReceiverTypeName {
get {
return receiverTypeName;
}
}
///
/// ProvidePropertyAttribute overrides this to include the type name and the property name
///
public override object TypeId {
get {
return GetType().FullName + propertyName;
}
}
public override bool Equals(object obj) {
if (obj == this) {
return true;
}
ProvidePropertyAttribute other = obj as ProvidePropertyAttribute;
return (other != null) && other.propertyName == propertyName && other.receiverTypeName == receiverTypeName;
}
public override int GetHashCode() {
return propertyName.GetHashCode() ^ receiverTypeName.GetHashCode();
}
}
}
// 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
- BrowserTree.cs
- CodeLinePragma.cs
- EDesignUtil.cs
- ErrorReporting.cs
- DelegatingConfigHost.cs
- Vector3DCollectionConverter.cs
- ControlBindingsCollection.cs
- ValidateNames.cs
- TemplateBindingExtension.cs
- MemberRelationshipService.cs
- SystemIPv6InterfaceProperties.cs
- ScriptingWebServicesSectionGroup.cs
- KerberosTicketHashIdentifierClause.cs
- KeyValuePairs.cs
- SoapAttributeOverrides.cs
- DesignerDataView.cs
- StaticDataManager.cs
- SingleConverter.cs
- IsolatedStorageFile.cs
- SqlDataSourceCommandEventArgs.cs
- Identifier.cs
- FixUp.cs
- WindowsTokenRoleProvider.cs
- PresentationTraceSources.cs
- FrameworkContextData.cs
- DoubleCollection.cs
- IsolatedStorageFilePermission.cs
- ChildrenQuery.cs
- ACE.cs
- ClientScriptManager.cs
- Italic.cs
- Model3DCollection.cs
- MonitorWrapper.cs
- FormsAuthenticationModule.cs
- _CommandStream.cs
- SoapAttributes.cs
- MethodBody.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- ScrollItemPattern.cs
- TimerEventSubscription.cs
- PolicyException.cs
- PrimitiveCodeDomSerializer.cs
- State.cs
- PeerTransportListenAddressConverter.cs
- XomlCompiler.cs
- XmlSerializerVersionAttribute.cs
- CommandBinding.cs
- EntityDataSourceQueryBuilder.cs
- transactioncontext.cs
- MaskDescriptors.cs
- Attributes.cs
- PeerToPeerException.cs
- StorageInfo.cs
- Ray3DHitTestResult.cs
- InternalConfigConfigurationFactory.cs
- GridViewColumn.cs
- UnionQueryOperator.cs
- InvalidTimeZoneException.cs
- WebPartZone.cs
- AuthenticodeSignatureInformation.cs
- DocumentViewerHelper.cs
- WebBaseEventKeyComparer.cs
- ADRoleFactory.cs
- FileDialogPermission.cs
- ObjectSpanRewriter.cs
- IIS7UserPrincipal.cs
- DispatcherExceptionFilterEventArgs.cs
- DynamicHyperLink.cs
- MultipartContentParser.cs
- DayRenderEvent.cs
- DoubleAnimationBase.cs
- BooleanStorage.cs
- AxHost.cs
- TemplateField.cs
- ControllableStoryboardAction.cs
- CqlParserHelpers.cs
- DataServiceConfiguration.cs
- formatter.cs
- SiteMapPathDesigner.cs
- WebServiceParameterData.cs
- XhtmlTextWriter.cs
- SystemWebExtensionsSectionGroup.cs
- SqlMethodCallConverter.cs
- PropertyValueChangedEvent.cs
- LineSegment.cs
- SerializerWriterEventHandlers.cs
- ReversePositionQuery.cs
- DecoderFallback.cs
- LogicalExpr.cs
- Stacktrace.cs
- _ListenerRequestStream.cs
- UriTemplateCompoundPathSegment.cs
- TextDpi.cs
- FrameworkContextData.cs
- SynchronizedDispatch.cs
- ConfigurationElement.cs
- TextParaClient.cs
- ErrorWrapper.cs
- EntityReference.cs
- BordersPage.cs