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
- ConfigurationValue.cs
- DelegateTypeInfo.cs
- EncoderParameters.cs
- DateTimeValueSerializer.cs
- TreeViewItem.cs
- RegionIterator.cs
- ObjectContext.cs
- SqlCacheDependencyDatabase.cs
- MetafileHeaderWmf.cs
- TemplatedWizardStep.cs
- GPStream.cs
- CodeIndexerExpression.cs
- ListViewDeleteEventArgs.cs
- SafePointer.cs
- ListBox.cs
- DbExpressionVisitor_TResultType.cs
- TimeoutException.cs
- ExtensionDataObject.cs
- DynamicField.cs
- Range.cs
- DnsPermission.cs
- _TransmitFileOverlappedAsyncResult.cs
- BooleanSwitch.cs
- SiteMapHierarchicalDataSourceView.cs
- DuplexChannel.cs
- ConstructorBuilder.cs
- RadioButtonList.cs
- RepeaterItemEventArgs.cs
- ZoneButton.cs
- ChtmlTextWriter.cs
- SqlDeflator.cs
- ContentTypeSettingClientMessageFormatter.cs
- ProcessThreadDesigner.cs
- ConfigXmlCDataSection.cs
- CacheModeConverter.cs
- EditorPartCollection.cs
- OdbcCommand.cs
- PrinterResolution.cs
- RegexReplacement.cs
- COAUTHIDENTITY.cs
- AudioLevelUpdatedEventArgs.cs
- Imaging.cs
- messageonlyhwndwrapper.cs
- IndexedSelectQueryOperator.cs
- SafeProcessHandle.cs
- StreamAsIStream.cs
- BinaryObjectWriter.cs
- TargetPerspective.cs
- DecimalFormatter.cs
- TimeZone.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- DbConnectionFactory.cs
- TemplateXamlTreeBuilder.cs
- XmlWriterSettings.cs
- FormViewPageEventArgs.cs
- SmtpFailedRecipientsException.cs
- ReadOnlyMetadataCollection.cs
- RoutedEventConverter.cs
- ColumnMapProcessor.cs
- ClientCultureInfo.cs
- TableHeaderCell.cs
- Animatable.cs
- WebConfigurationHostFileChange.cs
- ExpressionStringBuilder.cs
- ItemCollectionEditor.cs
- SynchronizationContext.cs
- Geometry.cs
- ReaderContextStackData.cs
- Types.cs
- NamedPipeActivation.cs
- Stackframe.cs
- SqlPersonalizationProvider.cs
- OracleSqlParser.cs
- COSERVERINFO.cs
- UrlMappingsModule.cs
- TransactionState.cs
- ModelItemCollection.cs
- FileStream.cs
- LogicalExpr.cs
- TextEffectCollection.cs
- SQLDecimalStorage.cs
- HttpCookie.cs
- LocatorBase.cs
- ObjectMemberMapping.cs
- AdRotator.cs
- ElementNotEnabledException.cs
- TypedElement.cs
- MergeFilterQuery.cs
- ResponseBodyWriter.cs
- objectresult_tresulttype.cs
- PermissionSetTriple.cs
- EntityClassGenerator.cs
- ToolStripGrip.cs
- AutomationPeer.cs
- RawStylusInputReport.cs
- FileStream.cs
- DataStreams.cs
- Site.cs
- FormViewCommandEventArgs.cs
- DefaultEvaluationContext.cs