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
- CharEntityEncoderFallback.cs
- TransformerTypeCollection.cs
- ImageBrush.cs
- PathFigure.cs
- HttpContext.cs
- WindowsToolbar.cs
- FixedSOMElement.cs
- WebPartUtil.cs
- TransformedBitmap.cs
- WebPartZone.cs
- MultipleViewPatternIdentifiers.cs
- DataGridViewLayoutData.cs
- MailDefinition.cs
- BindingValueChangedEventArgs.cs
- DataRecordObjectView.cs
- SoapSchemaImporter.cs
- DeviceOverridableAttribute.cs
- HostingPreferredMapPath.cs
- EdmFunction.cs
- XmlBufferReader.cs
- OdbcParameter.cs
- RegularExpressionValidator.cs
- TimeSpanMinutesConverter.cs
- JavascriptCallbackMessageInspector.cs
- C14NUtil.cs
- ClosableStream.cs
- BasicExpressionVisitor.cs
- WebScriptServiceHostFactory.cs
- BuildDependencySet.cs
- TdsParserHelperClasses.cs
- XmlArrayItemAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- PassportIdentity.cs
- PolyBezierSegment.cs
- CompositeDataBoundControl.cs
- SelectionItemProviderWrapper.cs
- SHA256Managed.cs
- WindowsFormsLinkLabel.cs
- HelpKeywordAttribute.cs
- ForeignKeyConstraint.cs
- ObjectListComponentEditor.cs
- TemplateXamlTreeBuilder.cs
- HtmlImageAdapter.cs
- ColumnReorderedEventArgs.cs
- RequestFactory.cs
- CfgParser.cs
- VariableQuery.cs
- RuntimeConfigurationRecord.cs
- NullableConverter.cs
- EntityCommand.cs
- DiscreteKeyFrames.cs
- DataViewManagerListItemTypeDescriptor.cs
- HitTestParameters.cs
- WindowVisualStateTracker.cs
- WebRequestModulesSection.cs
- WebBodyFormatMessageProperty.cs
- EventLogPermissionEntryCollection.cs
- Schema.cs
- _FixedSizeReader.cs
- QilValidationVisitor.cs
- UnsafeNativeMethods.cs
- DocumentReference.cs
- JsonReader.cs
- ExtendedPropertyDescriptor.cs
- AsyncResult.cs
- InlineObject.cs
- OutputScopeManager.cs
- BaseUriHelper.cs
- PresentationTraceSources.cs
- TraceProvider.cs
- ListControl.cs
- WmpBitmapEncoder.cs
- ViewCellRelation.cs
- WorkflowPrinting.cs
- BindingCompleteEventArgs.cs
- ThreadExceptionEvent.cs
- RangeValidator.cs
- DataBindEngine.cs
- TemplateXamlParser.cs
- AdministrationHelpers.cs
- ExternalException.cs
- SpellerStatusTable.cs
- TraceContext.cs
- SchemaMerger.cs
- DataGridViewColumnDesigner.cs
- TextElementEnumerator.cs
- Int32CAMarshaler.cs
- BinaryExpression.cs
- SynchronizationLockException.cs
- TypeInfo.cs
- DataServiceException.cs
- ButtonBase.cs
- ProviderUtil.cs
- AliasedSlot.cs
- PenContexts.cs
- Vars.cs
- XmlSerializer.cs
- DbMetaDataCollectionNames.cs
- Point3DKeyFrameCollection.cs
- EncryptedPackage.cs