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
- XamlSerializerUtil.cs
- PageBreakRecord.cs
- ButtonBaseAdapter.cs
- DesigntimeLicenseContextSerializer.cs
- ResumeStoryboard.cs
- OptimizerPatterns.cs
- TabRenderer.cs
- SizeConverter.cs
- DeploymentSection.cs
- DbException.cs
- ArrayWithOffset.cs
- MutableAssemblyCacheEntry.cs
- Stack.cs
- ContentPlaceHolder.cs
- HtmlImageAdapter.cs
- EpmCustomContentWriterNodeData.cs
- ScopedMessagePartSpecification.cs
- FullTextLine.cs
- Grid.cs
- TypedOperationInfo.cs
- XNameConverter.cs
- MobileErrorInfo.cs
- KoreanLunisolarCalendar.cs
- BaseParser.cs
- CompilerGlobalScopeAttribute.cs
- ConfigXmlDocument.cs
- ToolStripLocationCancelEventArgs.cs
- StatusBar.cs
- CmsInterop.cs
- ArcSegment.cs
- TreeNodeConverter.cs
- InputBindingCollection.cs
- BaseTemplateBuildProvider.cs
- PropertyPathWorker.cs
- XsltFunctions.cs
- TdsParserStaticMethods.cs
- ObjectSet.cs
- DataGridLength.cs
- FixedHyperLink.cs
- RegexParser.cs
- RoutedEvent.cs
- Debug.cs
- Brush.cs
- EpmContentDeSerializer.cs
- SqlMethods.cs
- Wildcard.cs
- ArraySubsetEnumerator.cs
- ConfigurationValidatorAttribute.cs
- MetabaseSettingsIis7.cs
- baseaxisquery.cs
- GroupAggregateExpr.cs
- MD5Cng.cs
- AssociationSet.cs
- ToolStripDropDownClosingEventArgs.cs
- XmlSchemaAttribute.cs
- SelectionEditor.cs
- TreeView.cs
- DataGridViewComboBoxEditingControl.cs
- XmlDataLoader.cs
- OracleTimeSpan.cs
- PinProtectionHelper.cs
- SqlAggregateChecker.cs
- CodeMethodReturnStatement.cs
- InvalidPropValue.cs
- Vector3DAnimation.cs
- NavigationEventArgs.cs
- EventRoute.cs
- AppSettingsExpressionBuilder.cs
- SoapCodeExporter.cs
- WeakReferenceEnumerator.cs
- FunctionParameter.cs
- WizardStepBase.cs
- DataContractSerializerSection.cs
- UpdateTranslator.cs
- Queue.cs
- TypeLoadException.cs
- MembershipPasswordException.cs
- SwitchLevelAttribute.cs
- NameValueSectionHandler.cs
- ObjectCloneHelper.cs
- WebColorConverter.cs
- MarkupObject.cs
- prompt.cs
- ZipIOLocalFileHeader.cs
- BoundPropertyEntry.cs
- Panel.cs
- LinkedResourceCollection.cs
- UIElement3DAutomationPeer.cs
- SecondaryViewProvider.cs
- ProgressChangedEventArgs.cs
- SqlClientFactory.cs
- XmlSignatureProperties.cs
- ImageMetadata.cs
- FtpWebResponse.cs
- FormatControl.cs
- FormattedText.cs
- RuntimeArgumentHandle.cs
- ConfigXmlSignificantWhitespace.cs
- Ipv6Element.cs
- BuilderInfo.cs