Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- XsltArgumentList.cs
- XmlSchemaSimpleContentRestriction.cs
- ComboBoxItem.cs
- CorrelationTokenInvalidatedHandler.cs
- StateDesigner.CommentLayoutGlyph.cs
- ListViewItem.cs
- PrimitiveSchema.cs
- odbcmetadatafactory.cs
- ColumnResizeAdorner.cs
- IsolatedStorageException.cs
- WCFBuildProvider.cs
- WebReferencesBuildProvider.cs
- Types.cs
- TrackingSection.cs
- IPAddress.cs
- HttpModuleAction.cs
- BamlMapTable.cs
- DataAdapter.cs
- PointAnimation.cs
- IdentitySection.cs
- MessageBuilder.cs
- EncoderReplacementFallback.cs
- figurelengthconverter.cs
- WebControl.cs
- SignedXml.cs
- XmlSchemaValidationException.cs
- MarkupProperty.cs
- Root.cs
- XmlCharCheckingReader.cs
- UniqueEventHelper.cs
- processwaithandle.cs
- XsdDataContractImporter.cs
- XmlArrayAttribute.cs
- embossbitmapeffect.cs
- SignedPkcs7.cs
- ReferentialConstraint.cs
- HtmlInputPassword.cs
- ToolStripSettings.cs
- PeerInvitationResponse.cs
- IdentityHolder.cs
- LocalizationParserHooks.cs
- QuaternionAnimationBase.cs
- ErrorWrapper.cs
- Vector3DAnimationBase.cs
- SHA256.cs
- ReferencedCollectionType.cs
- DependencyObject.cs
- XmlSchemas.cs
- ServiceDescription.cs
- KeyFrames.cs
- EntryPointNotFoundException.cs
- _HeaderInfoTable.cs
- BamlTreeNode.cs
- AssociationEndMember.cs
- ThreadStartException.cs
- EntitySqlQueryBuilder.cs
- MediaSystem.cs
- DataRecordInternal.cs
- XmlSerializerVersionAttribute.cs
- ListControlBoundActionList.cs
- FlowDocument.cs
- MarshalByValueComponent.cs
- RectangleGeometry.cs
- FormsIdentity.cs
- InputLanguageCollection.cs
- cookiecollection.cs
- QueryContinueDragEventArgs.cs
- AttributeCollection.cs
- PrimaryKeyTypeConverter.cs
- FormsAuthenticationTicket.cs
- HyperLink.cs
- HttpWriter.cs
- HostProtectionPermission.cs
- MulticastIPAddressInformationCollection.cs
- FormConverter.cs
- X509CertificateClaimSet.cs
- TextElement.cs
- DataGridViewButtonColumn.cs
- HttpRawResponse.cs
- PathGeometry.cs
- UpdatePanelControlTrigger.cs
- BindStream.cs
- SQLMembershipProvider.cs
- SystemParameters.cs
- DataGridViewCellValueEventArgs.cs
- AuthenticationException.cs
- InfoCardTrace.cs
- ProcessHost.cs
- SmtpFailedRecipientsException.cs
- FrameSecurityDescriptor.cs
- WithParamAction.cs
- EntityDataSourceContextCreatedEventArgs.cs
- EventlogProvider.cs
- SigningCredentials.cs
- VerificationException.cs
- SystemInfo.cs
- IntSecurity.cs
- SynchronizingStream.cs
- Codec.cs
- CommonXSendMessage.cs