Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / ProvidePropertyAttribute.cs / 1 / 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();
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColorMap.cs
- Separator.cs
- Section.cs
- StreamResourceInfo.cs
- DefaultValueTypeConverter.cs
- ReservationNotFoundException.cs
- _SpnDictionary.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- MetaModel.cs
- SequenceNumber.cs
- EventWaitHandle.cs
- XmlValidatingReader.cs
- EditorZone.cs
- OleDbMetaDataFactory.cs
- FixedDocumentPaginator.cs
- RangeValidator.cs
- CollectionConverter.cs
- DecimalConstantAttribute.cs
- EntityReference.cs
- Maps.cs
- CrossAppDomainChannel.cs
- SafeNativeMethods.cs
- GeneralTransform3DTo2D.cs
- FormViewUpdatedEventArgs.cs
- OdbcConnection.cs
- BrushMappingModeValidation.cs
- SBCSCodePageEncoding.cs
- DataBoundControl.cs
- ResourceManagerWrapper.cs
- PageSetupDialog.cs
- OrderedParallelQuery.cs
- AsymmetricCryptoHandle.cs
- Triplet.cs
- PrincipalPermissionMode.cs
- TextChange.cs
- GroupQuery.cs
- SafeRegistryKey.cs
- TextRangeEditLists.cs
- SoapAttributeAttribute.cs
- StrokeDescriptor.cs
- ColorConvertedBitmapExtension.cs
- Codec.cs
- GraphicsState.cs
- ProjectionPlanCompiler.cs
- InstalledFontCollection.cs
- ExpressionBuilderCollection.cs
- DelegatedStream.cs
- NodeInfo.cs
- SqlWriter.cs
- RootBuilder.cs
- SchemaImporterExtensionsSection.cs
- CodeLinePragma.cs
- EntityDataSourceColumn.cs
- WebPartChrome.cs
- HotCommands.cs
- Border.cs
- TextBox.cs
- DateTimeOffsetStorage.cs
- SmtpFailedRecipientsException.cs
- OrderByBuilder.cs
- NextPreviousPagerField.cs
- StoryFragments.cs
- ECDsa.cs
- HandleTable.cs
- HttpApplicationStateBase.cs
- UserControlCodeDomTreeGenerator.cs
- PnrpPermission.cs
- BinHexDecoder.cs
- ArithmeticLiteral.cs
- M3DUtil.cs
- CreateInstanceBinder.cs
- BrowserCapabilitiesFactory35.cs
- OutputCacheSettings.cs
- AttachmentService.cs
- NetTcpSection.cs
- StylusShape.cs
- TlsnegoTokenAuthenticator.cs
- FontSource.cs
- DataColumnMapping.cs
- elementinformation.cs
- DataTableCollection.cs
- HttpPostClientProtocol.cs
- CryptoProvider.cs
- SoapClientMessage.cs
- GridView.cs
- FormsAuthenticationCredentials.cs
- GC.cs
- RadialGradientBrush.cs
- AuthenticationModulesSection.cs
- DisposableCollectionWrapper.cs
- Permission.cs
- HttpBrowserCapabilitiesWrapper.cs
- TraceHelpers.cs
- DataGridViewComboBoxCell.cs
- CheckoutException.cs
- DataGridClipboardHelper.cs
- IQueryable.cs
- SiteMembershipCondition.cs
- TextEvent.cs
- NameSpaceExtractor.cs