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
- DataMemberAttribute.cs
- Block.cs
- Utils.cs
- VBIdentifierNameEditor.cs
- ProfilePropertyNameValidator.cs
- XmlFormatExtensionPrefixAttribute.cs
- OverlappedContext.cs
- SmtpNetworkElement.cs
- ConditionValidator.cs
- EntityDataSourceDataSelection.cs
- AutomationPropertyInfo.cs
- RegistryPermission.cs
- XmlSerializer.cs
- ArrayTypeMismatchException.cs
- RadioButton.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ObservableCollection.cs
- Token.cs
- TokenBasedSet.cs
- StorageScalarPropertyMapping.cs
- QueryStringHandler.cs
- CompiledAction.cs
- Label.cs
- StylusPointProperties.cs
- HuffCodec.cs
- FixedNode.cs
- Paragraph.cs
- FileSystemWatcher.cs
- ObjectViewFactory.cs
- Guid.cs
- WebPermission.cs
- UIElementHelper.cs
- BinaryFormatterWriter.cs
- ConfigUtil.cs
- NTAccount.cs
- SqlConnectionManager.cs
- XPathAncestorIterator.cs
- DataObjectAttribute.cs
- BitVector32.cs
- InstanceData.cs
- SiteOfOriginContainer.cs
- ControlCollection.cs
- DataSetViewSchema.cs
- TouchesCapturedWithinProperty.cs
- BinaryFormatterWriter.cs
- SafeProcessHandle.cs
- EntitySetBase.cs
- ComponentResourceManager.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- TransformCollection.cs
- TrackBar.cs
- PenLineJoinValidation.cs
- QuotedStringFormatReader.cs
- ListControlDataBindingHandler.cs
- TimeoutException.cs
- MenuItem.cs
- TextRunCache.cs
- GeneralTransform3DGroup.cs
- DSACryptoServiceProvider.cs
- UrlMappingsSection.cs
- XmlSchemaAll.cs
- CallbackException.cs
- MessageEncodingBindingElementImporter.cs
- Control.cs
- DecimalAnimationUsingKeyFrames.cs
- ClusterRegistryConfigurationProvider.cs
- BamlResourceContent.cs
- HttpCacheVary.cs
- MapPathBasedVirtualPathProvider.cs
- ProviderIncompatibleException.cs
- SoapConverter.cs
- DocumentApplicationJournalEntry.cs
- OutputCacheProfile.cs
- ExpandedWrapper.cs
- Accessible.cs
- Label.cs
- WpfKnownMemberInvoker.cs
- LoginUtil.cs
- SystemEvents.cs
- TypeUnloadedException.cs
- DataBinding.cs
- InkCollectionBehavior.cs
- ArgumentException.cs
- ObjectStateFormatter.cs
- ListBindingConverter.cs
- DocumentViewerConstants.cs
- EncodingTable.cs
- ImageListStreamer.cs
- ShaderRenderModeValidation.cs
- QuotedPrintableStream.cs
- ProjectionPath.cs
- WpfKnownMemberInvoker.cs
- DeleteIndexBinder.cs
- HierarchicalDataBoundControlAdapter.cs
- WebPartExportVerb.cs
- UITypeEditor.cs
- BulletedListEventArgs.cs
- ReturnEventArgs.cs
- ModelUIElement3D.cs
- XPathNodeHelper.cs