Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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
- ConstraintConverter.cs
- XmlElementList.cs
- DataObjectSettingDataEventArgs.cs
- ApplicationException.cs
- EntityConnectionStringBuilder.cs
- xml.cs
- SQLConvert.cs
- Privilege.cs
- MethodBuilderInstantiation.cs
- LogExtent.cs
- DataAdapter.cs
- AssemblyBuilder.cs
- DesignerVerb.cs
- LifetimeServices.cs
- ValidatedControlConverter.cs
- DataServiceBuildProvider.cs
- ClrPerspective.cs
- XPathSelfQuery.cs
- PixelShader.cs
- DescendantOverDescendantQuery.cs
- ButtonColumn.cs
- Renderer.cs
- DBConcurrencyException.cs
- RawStylusInputCustomData.cs
- PrtTicket_Base.cs
- RawMouseInputReport.cs
- PathParser.cs
- cryptoapiTransform.cs
- TopClause.cs
- FormatVersion.cs
- NetWebProxyFinder.cs
- UnsafeNativeMethods.cs
- DrawListViewColumnHeaderEventArgs.cs
- SizeIndependentAnimationStorage.cs
- ColorKeyFrameCollection.cs
- WinEventTracker.cs
- CalculatedColumn.cs
- BaseAsyncResult.cs
- ListContractAdapter.cs
- ContentDesigner.cs
- SchemaConstraints.cs
- XmlAnyElementAttribute.cs
- PropertyEmitter.cs
- Tuple.cs
- Wizard.cs
- CodeVariableReferenceExpression.cs
- SchemaReference.cs
- ParameterElementCollection.cs
- XmlRawWriter.cs
- ScrollChrome.cs
- TemplateControl.cs
- CatalogZone.cs
- Serializer.cs
- AlignmentXValidation.cs
- DbTransaction.cs
- DataListComponentEditor.cs
- SmiRecordBuffer.cs
- GlyphsSerializer.cs
- TemplateControlBuildProvider.cs
- RsaSecurityKey.cs
- MonthChangedEventArgs.cs
- CacheAxisQuery.cs
- CharacterBufferReference.cs
- XpsFixedPageReaderWriter.cs
- IntranetCredentialPolicy.cs
- BitVec.cs
- BaseAppDomainProtocolHandler.cs
- WorkflowTransactionOptions.cs
- TableItemStyle.cs
- ResourceReferenceExpressionConverter.cs
- HwndProxyElementProvider.cs
- DetailsViewPagerRow.cs
- HttpCachePolicyElement.cs
- ImageCodecInfoPrivate.cs
- SymLanguageVendor.cs
- GPPOINT.cs
- PropertyInformationCollection.cs
- CompositeScriptReference.cs
- RichTextBoxContextMenu.cs
- _SslSessionsCache.cs
- Effect.cs
- DrawingContextWalker.cs
- BinHexEncoding.cs
- DockPattern.cs
- UnknownWrapper.cs
- XPathMultyIterator.cs
- GestureRecognizer.cs
- URLMembershipCondition.cs
- METAHEADER.cs
- FlowDocumentReader.cs
- Double.cs
- LabelAutomationPeer.cs
- ParagraphVisual.cs
- ObfuscationAttribute.cs
- SrgsRuleRef.cs
- SQLConvert.cs
- LinkLabel.cs
- XsdDateTime.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- PageThemeParser.cs