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
- SerializationTrace.cs
- FormsAuthenticationCredentials.cs
- SiteMapNodeItemEventArgs.cs
- NonClientArea.cs
- DependencyPropertyValueSerializer.cs
- PrincipalPermission.cs
- SecurityChannel.cs
- ParseElement.cs
- SqlConnectionPoolGroupProviderInfo.cs
- GeometryModel3D.cs
- Graph.cs
- ReverseQueryOperator.cs
- DataGridViewColumnCollectionEditor.cs
- CollectionViewGroupRoot.cs
- WebScriptEnablingBehavior.cs
- Help.cs
- SQLResource.cs
- GiveFeedbackEvent.cs
- DataGridView.cs
- SingleKeyFrameCollection.cs
- SchemaRegistration.cs
- FrameworkElementAutomationPeer.cs
- ExpandedWrapper.cs
- MemberDomainMap.cs
- InternalEnumValidator.cs
- DataGridCellsPresenter.cs
- MenuItemStyle.cs
- Button.cs
- TextServicesCompartmentContext.cs
- LogicalExpr.cs
- FilteredDataSetHelper.cs
- EntityConnection.cs
- CompleteWizardStep.cs
- PowerEase.cs
- CollectionViewProxy.cs
- EncryptedReference.cs
- UIntPtr.cs
- XmlSerializerOperationFormatter.cs
- DecimalAnimation.cs
- TextDataBindingHandler.cs
- TTSVoice.cs
- DisplayMemberTemplateSelector.cs
- __Filters.cs
- WeakReferenceEnumerator.cs
- RTLAwareMessageBox.cs
- CellTreeNodeVisitors.cs
- BitConverter.cs
- QilName.cs
- Html32TextWriter.cs
- FigureParaClient.cs
- ThicknessAnimationBase.cs
- CodeAttributeArgument.cs
- PublisherIdentityPermission.cs
- ComponentDispatcherThread.cs
- XmlDownloadManager.cs
- HttpModuleAction.cs
- XmlBaseReader.cs
- OuterGlowBitmapEffect.cs
- WebPartRestoreVerb.cs
- PropertyCondition.cs
- SizeConverter.cs
- ImageListStreamer.cs
- FlowLayout.cs
- EpmSyndicationContentSerializer.cs
- RegexWriter.cs
- SqlWorkflowPersistenceService.cs
- TripleDESCryptoServiceProvider.cs
- SimpleApplicationHost.cs
- StateManagedCollection.cs
- TypeUtil.cs
- UnsafeNativeMethods.cs
- ReplacementText.cs
- AddInServer.cs
- WebPartConnectionsConnectVerb.cs
- MatrixKeyFrameCollection.cs
- ThreadAttributes.cs
- KeyConstraint.cs
- SplineQuaternionKeyFrame.cs
- DecoratedNameAttribute.cs
- LinqDataSourceView.cs
- GuidTagList.cs
- ExpressionEditorAttribute.cs
- NamespaceList.cs
- AdvancedBindingEditor.cs
- BitmapSizeOptions.cs
- SplitterDesigner.cs
- StopRoutingHandler.cs
- InstanceCollisionException.cs
- XmlSerializerAssemblyAttribute.cs
- WebPartVerb.cs
- GlobalEventManager.cs
- InputEventArgs.cs
- MsmqTransportSecurity.cs
- SystemColors.cs
- ApplicationServiceHelper.cs
- EventlogProvider.cs
- ContextQuery.cs
- ObjectTokenCategory.cs
- SqlCommandAsyncResult.cs
- BindingUtils.cs