Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SQLInt16Storage.cs
- XamlToRtfWriter.cs
- DataServiceProviderWrapper.cs
- EdmType.cs
- nulltextcontainer.cs
- ThreadStateException.cs
- Parameter.cs
- CurrentTimeZone.cs
- ReflectionPermission.cs
- Ipv6Element.cs
- Opcode.cs
- _SpnDictionary.cs
- _BasicClient.cs
- CompilerLocalReference.cs
- FixedNode.cs
- Content.cs
- InputBuffer.cs
- ListChunk.cs
- ISO2022Encoding.cs
- ListViewHitTestInfo.cs
- RequestSecurityTokenResponse.cs
- COM2TypeInfoProcessor.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- FormatException.cs
- cryptoapiTransform.cs
- ExternalFile.cs
- FontStretchConverter.cs
- SerialPinChanges.cs
- ActiveXHelper.cs
- XmlSerializationGeneratedCode.cs
- TypeListConverter.cs
- DoubleStorage.cs
- DateTimeUtil.cs
- ExpressionQuoter.cs
- CodeExpressionStatement.cs
- ComponentEditorForm.cs
- UnsafeNativeMethods.cs
- WebContentFormatHelper.cs
- Geometry.cs
- TrustSection.cs
- SqlPersistenceProviderFactory.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- SqlConnectionPoolGroupProviderInfo.cs
- messageonlyhwndwrapper.cs
- RootBrowserWindow.cs
- TabRenderer.cs
- XmlAttributeCollection.cs
- WebPartAuthorizationEventArgs.cs
- Point3DValueSerializer.cs
- ContractHandle.cs
- ConfigurationStrings.cs
- Trace.cs
- CannotUnloadAppDomainException.cs
- CertificateReferenceElement.cs
- IIS7WorkerRequest.cs
- ButtonAutomationPeer.cs
- CodeNamespaceCollection.cs
- UrlPath.cs
- CalendarDay.cs
- WebPartConnectionsConnectVerb.cs
- PrimitiveDataContract.cs
- BaseDataListActionList.cs
- CodeCastExpression.cs
- ActivityMetadata.cs
- HostingEnvironmentWrapper.cs
- XPathScanner.cs
- ExtendedProtectionPolicy.cs
- ViewManagerAttribute.cs
- FileClassifier.cs
- MethodImplAttribute.cs
- SectionInput.cs
- ConfigXmlElement.cs
- ButtonBase.cs
- DataRelation.cs
- FlatButtonAppearance.cs
- SerialPinChanges.cs
- SqlWriter.cs
- TextServicesProperty.cs
- ActivityMetadata.cs
- SqlTransaction.cs
- ServiceContractViewControl.Designer.cs
- HttpWriter.cs
- Path.cs
- UriExt.cs
- CompilerGlobalScopeAttribute.cs
- DataControlImageButton.cs
- SystemIPv6InterfaceProperties.cs
- QilList.cs
- SqlCacheDependencySection.cs
- ServiceChannelManager.cs
- GeneralTransform3DCollection.cs
- TreeNodeCollectionEditorDialog.cs
- ExtenderProvidedPropertyAttribute.cs
- GridLengthConverter.cs
- _LocalDataStore.cs
- StringCollectionEditor.cs
- TypefaceCollection.cs
- SapiRecoContext.cs
- HeaderedItemsControl.cs
- WebPartConnectionsDisconnectVerb.cs