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; ////// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class ProvidePropertyAttribute : Attribute { private readonly string propertyName; private readonly string receiverTypeName; ///Specifies which methods are extender /// properties. ////// 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; } ///Initializes a new instance of the ///class. /// public string PropertyName { get { return propertyName; } } ////// Gets the name of a property that this class provides. /// ////// public string ReceiverTypeName { get { return receiverTypeName; } } ////// Gets the name of the data type this property can extend /// ////// 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(); } } }ProvidePropertyAttribute overrides this to include the type name and the property name ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GroupedContextMenuStrip.cs
- StringStorage.cs
- MsmqReceiveHelper.cs
- OrderedDictionaryStateHelper.cs
- HttpModulesSection.cs
- LineServicesRun.cs
- DependencyPropertyChangedEventArgs.cs
- UseAttributeSetsAction.cs
- ChangeTracker.cs
- EventBuilder.cs
- HttpStreamXmlDictionaryWriter.cs
- LayoutTableCell.cs
- CodeExporter.cs
- DPAPIProtectedConfigurationProvider.cs
- DecoratedNameAttribute.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- DataAdapter.cs
- WsdlImporterElement.cs
- ConfigurationManagerHelper.cs
- PagesSection.cs
- IndividualDeviceConfig.cs
- CookielessHelper.cs
- WindowsStartMenu.cs
- FocusWithinProperty.cs
- XmlElementAttribute.cs
- XmlAnyAttributeAttribute.cs
- DirectoryRedirect.cs
- CompiledQuery.cs
- PropertyMetadata.cs
- Decorator.cs
- ConstNode.cs
- DoubleAnimationUsingPath.cs
- DoubleLinkList.cs
- DocumentSequence.cs
- InternalSafeNativeMethods.cs
- IImplicitResourceProvider.cs
- Int64Storage.cs
- SmiXetterAccessMap.cs
- PanelStyle.cs
- SingleObjectCollection.cs
- GenericEnumConverter.cs
- Assembly.cs
- DateTimeAutomationPeer.cs
- DrawingGroup.cs
- MemberPath.cs
- TextSchema.cs
- MustUnderstandBehavior.cs
- BaseAddressPrefixFilterElementCollection.cs
- InputBinder.cs
- MILUtilities.cs
- SmtpMail.cs
- KeyedCollection.cs
- MetricEntry.cs
- BaseAppDomainProtocolHandler.cs
- WebControlAdapter.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Renderer.cs
- GeneralTransform3DTo2D.cs
- XmlImplementation.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- SmtpTransport.cs
- ProviderUtil.cs
- GZipStream.cs
- AnonymousIdentificationSection.cs
- SvcMapFileSerializer.cs
- CleanUpVirtualizedItemEventArgs.cs
- RadioButtonList.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- ColumnPropertiesGroup.cs
- Delegate.cs
- XmlEntity.cs
- CheckBoxList.cs
- XPathMessageFilterTable.cs
- OLEDB_Enum.cs
- FilterQuery.cs
- IISMapPath.cs
- COM2EnumConverter.cs
- ReliableSession.cs
- ImpersonateTokenRef.cs
- DataObject.cs
- DbBuffer.cs
- WorkflowServiceInstance.cs
- CacheOutputQuery.cs
- ProcessHostConfigUtils.cs
- ListSourceHelper.cs
- DataContractSerializerFaultFormatter.cs
- HostedElements.cs
- StringValidator.cs
- InsufficientExecutionStackException.cs
- SafeNativeMethods.cs
- OdbcCommandBuilder.cs
- ControlPersister.cs
- XmlDomTextWriter.cs
- HttpApplication.cs
- FlowDocumentReaderAutomationPeer.cs
- Pkcs9Attribute.cs
- CompositeActivityValidator.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DataSvcMapFileSerializer.cs
- HierarchicalDataBoundControlAdapter.cs