Code:
/ 4.0 / 4.0 / 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; ////// [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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //ProvidePropertyAttribute overrides this to include the type name and the property name ///// 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(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.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
- XmlSchemaAttributeGroupRef.cs
- StaticResourceExtension.cs
- SqlBuffer.cs
- PenThread.cs
- FormatStringEditor.cs
- EmptyControlCollection.cs
- ExpressionPrefixAttribute.cs
- SpStreamWrapper.cs
- SafeHandles.cs
- ReverseInheritProperty.cs
- HttpHandlerActionCollection.cs
- ColumnClickEvent.cs
- SessionState.cs
- GridItemCollection.cs
- DataControlField.cs
- InputQueue.cs
- DecoderFallbackWithFailureFlag.cs
- RC2.cs
- XmlSchemaComplexType.cs
- RotationValidation.cs
- BuildProvider.cs
- AuthenticationManager.cs
- ResourceBinder.cs
- ExpressionLexer.cs
- TypeTypeConverter.cs
- PerformanceCounterCategory.cs
- ToolStripSeparatorRenderEventArgs.cs
- sqlser.cs
- ClientScriptManagerWrapper.cs
- ParsedAttributeCollection.cs
- GenericRootAutomationPeer.cs
- DataReaderContainer.cs
- MissingSatelliteAssemblyException.cs
- ValidationError.cs
- Sql8ExpressionRewriter.cs
- UnsafeNativeMethods.cs
- elementinformation.cs
- DataGridViewTextBoxEditingControl.cs
- SqlProcedureAttribute.cs
- SafePEFileHandle.cs
- FunctionMappingTranslator.cs
- PageThemeBuildProvider.cs
- CookieProtection.cs
- DurationConverter.cs
- TryLoadRunnableWorkflowCommand.cs
- QueryReaderSettings.cs
- WebServiceHandler.cs
- EDesignUtil.cs
- ProvidersHelper.cs
- GlyphTypeface.cs
- CodeLinePragma.cs
- ConnectionManagementElementCollection.cs
- infer.cs
- CodeSubDirectory.cs
- LongMinMaxAggregationOperator.cs
- GridViewCommandEventArgs.cs
- JsonObjectDataContract.cs
- NameSpaceEvent.cs
- IndexedDataBuffer.cs
- PropertyValueUIItem.cs
- ActionMessageFilter.cs
- CommandHelper.cs
- DataGridViewBand.cs
- DataGridViewCellStyleConverter.cs
- BaseDataList.cs
- HtmlContainerControl.cs
- ClientTargetSection.cs
- ContentDesigner.cs
- TraceHandler.cs
- Bind.cs
- oledbmetadatacollectionnames.cs
- ServiceOperationHelpers.cs
- Grant.cs
- ClickablePoint.cs
- RijndaelManagedTransform.cs
- EntityConnectionStringBuilderItem.cs
- SystemTcpStatistics.cs
- ExtenderHelpers.cs
- ListControlConvertEventArgs.cs
- ExecutionTracker.cs
- DataGridAutoFormatDialog.cs
- ZoneIdentityPermission.cs
- HashAlgorithm.cs
- DesignerActionItemCollection.cs
- EntitySetBase.cs
- SoapInteropTypes.cs
- SurrogateEncoder.cs
- iisPickupDirectory.cs
- SqlDeflator.cs
- WebServiceData.cs
- SHA384Managed.cs
- DataConnectionHelper.cs
- _ConnectionGroup.cs
- DataColumnPropertyDescriptor.cs
- TextRunTypographyProperties.cs
- Array.cs
- Command.cs
- SafeEventLogWriteHandle.cs
- LOSFormatter.cs
- IPHostEntry.cs