Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Base / MS / Internal / ComponentModel / DependencyPropertyAttribute.cs / 1 / DependencyPropertyAttribute.cs
namespace MS.Internal.ComponentModel { using System; using System.Windows; ////// This attribute is synthesized by our DependencyObjectProvider /// to relate a property descriptor back to a dependency property. /// [AttributeUsage(AttributeTargets.Method)] internal sealed class DependencyPropertyAttribute : Attribute { //------------------------------------------------------ // // Constructors // //----------------------------------------------------- #region Constructors ////// Creates a new DependencyPropertyAttribute for the given dependency property. /// internal DependencyPropertyAttribute(DependencyProperty dependencyProperty, bool isAttached) { if (dependencyProperty == null) throw new ArgumentNullException("dependencyProperty"); _dp = dependencyProperty; _isAttached = isAttached; } #endregion Constructors //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Override of Object.Equals that returns true when the dependency /// property contained within each attribute is the same. /// public override bool Equals(object value) { DependencyPropertyAttribute da = value as DependencyPropertyAttribute; if (da != null && object.ReferenceEquals(da._dp, _dp) && da._isAttached == _isAttached) { return true; } return false; } ////// Override of Object.GetHashCode(); /// public override int GetHashCode() { return _dp.GetHashCode(); } #endregion Public Methods //------------------------------------------------------ // // Public Operators // //----------------------------------------------------- //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ #region Public Properties ////// Overrides Attribute.TypeId to be unique with respect to /// other dependency property attributes.c /// public override object TypeId { get { return typeof(DependencyPropertyAttribute); } } #endregion Public Properties //----------------------------------------------------- // // Public Events // //------------------------------------------------------ //----------------------------------------------------- // // Internal Properties // //----------------------------------------------------- #region Internal Properties ////// Returns whether the dependency property is an attached /// property. /// internal bool IsAttached { get { return _isAttached; } } ////// Returns the dependency property instance this attribute is /// associated with. /// internal DependencyProperty DependencyProperty { get { return _dp; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private DependencyProperty _dp; private bool _isAttached; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace MS.Internal.ComponentModel { using System; using System.Windows; ////// This attribute is synthesized by our DependencyObjectProvider /// to relate a property descriptor back to a dependency property. /// [AttributeUsage(AttributeTargets.Method)] internal sealed class DependencyPropertyAttribute : Attribute { //------------------------------------------------------ // // Constructors // //----------------------------------------------------- #region Constructors ////// Creates a new DependencyPropertyAttribute for the given dependency property. /// internal DependencyPropertyAttribute(DependencyProperty dependencyProperty, bool isAttached) { if (dependencyProperty == null) throw new ArgumentNullException("dependencyProperty"); _dp = dependencyProperty; _isAttached = isAttached; } #endregion Constructors //----------------------------------------------------- // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Override of Object.Equals that returns true when the dependency /// property contained within each attribute is the same. /// public override bool Equals(object value) { DependencyPropertyAttribute da = value as DependencyPropertyAttribute; if (da != null && object.ReferenceEquals(da._dp, _dp) && da._isAttached == _isAttached) { return true; } return false; } ////// Override of Object.GetHashCode(); /// public override int GetHashCode() { return _dp.GetHashCode(); } #endregion Public Methods //------------------------------------------------------ // // Public Operators // //----------------------------------------------------- //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ #region Public Properties ////// Overrides Attribute.TypeId to be unique with respect to /// other dependency property attributes.c /// public override object TypeId { get { return typeof(DependencyPropertyAttribute); } } #endregion Public Properties //----------------------------------------------------- // // Public Events // //------------------------------------------------------ //----------------------------------------------------- // // Internal Properties // //----------------------------------------------------- #region Internal Properties ////// Returns whether the dependency property is an attached /// property. /// internal bool IsAttached { get { return _isAttached; } } ////// Returns the dependency property instance this attribute is /// associated with. /// internal DependencyProperty DependencyProperty { get { return _dp; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private DependencyProperty _dp; private bool _isAttached; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SecurityContextSecurityTokenAuthenticator.cs
- CustomError.cs
- Expression.cs
- AudioBase.cs
- BitmapFrameDecode.cs
- ExtensionCollection.cs
- OperatingSystem.cs
- DoubleConverter.cs
- SqlDataSourceSelectingEventArgs.cs
- InputScopeNameConverter.cs
- OAVariantLib.cs
- FileSystemInfo.cs
- MemberListBinding.cs
- SoapProtocolImporter.cs
- ACL.cs
- RegistrySecurity.cs
- GridViewRowCollection.cs
- Switch.cs
- Assembly.cs
- TextBoxRenderer.cs
- TreeNodeBindingCollection.cs
- XmlWhitespace.cs
- FormViewCommandEventArgs.cs
- PerformanceCounterCategory.cs
- OleDbError.cs
- XmlSchemaNotation.cs
- RtType.cs
- FtpCachePolicyElement.cs
- ServiceMetadataExtension.cs
- CachedPathData.cs
- GeneratedContractType.cs
- ZeroOpNode.cs
- Keywords.cs
- EdgeProfileValidation.cs
- InvalidCastException.cs
- HttpCacheVaryByContentEncodings.cs
- ScriptServiceAttribute.cs
- WebBrowser.cs
- BuildManagerHost.cs
- SafeThemeHandle.cs
- AddInToken.cs
- CodeRegionDirective.cs
- Mutex.cs
- ConnectionManagementElement.cs
- ImageField.cs
- SrgsGrammar.cs
- XmlSchemaComplexContentRestriction.cs
- PerformanceCountersBase.cs
- EventInfo.cs
- PopupRoot.cs
- URIFormatException.cs
- ItemsControl.cs
- RequiredArgumentAttribute.cs
- SizeF.cs
- OutputCacheSettingsSection.cs
- DiscoveryDocumentLinksPattern.cs
- WebEvents.cs
- ResourceReferenceExpressionConverter.cs
- SubpageParagraph.cs
- CommandBinding.cs
- StorageMappingItemCollection.cs
- PassportIdentity.cs
- CacheHelper.cs
- UDPClient.cs
- CompressionTransform.cs
- XmlSchemaElement.cs
- AuthorizationRuleCollection.cs
- ServerIdentity.cs
- ColorInterpolationModeValidation.cs
- CharAnimationUsingKeyFrames.cs
- PrintDialog.cs
- TypeConverterHelper.cs
- AutomationPropertyChangedEventArgs.cs
- XmlSchemaSimpleContentExtension.cs
- TextCompositionEventArgs.cs
- SequenceDesigner.cs
- ISFClipboardData.cs
- RegistrySecurity.cs
- InternalTypeHelper.cs
- LookupNode.cs
- RoleBoolean.cs
- ContentPresenter.cs
- Dictionary.cs
- FontFamilyIdentifier.cs
- ParseChildrenAsPropertiesAttribute.cs
- DataGridViewHeaderCell.cs
- RecognitionResult.cs
- LoadRetryHandler.cs
- PtsPage.cs
- ListChunk.cs
- SafeRegistryKey.cs
- BroadcastEventHelper.cs
- BoolLiteral.cs
- Types.cs
- RegistryPermission.cs
- ItemCheckedEvent.cs
- DataMisalignedException.cs
- NamespaceEmitter.cs
- MergePropertyDescriptor.cs
- ToggleButton.cs