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
- Timeline.cs
- PrintDocument.cs
- XmlSerializerFactory.cs
- BridgeDataRecord.cs
- SQLDoubleStorage.cs
- QueryResults.cs
- OperatingSystem.cs
- TableSectionStyle.cs
- TdsParserStateObject.cs
- MeasureItemEvent.cs
- CompositeDuplexBindingElement.cs
- MessageBox.cs
- PersonalizationState.cs
- XmlSerializerVersionAttribute.cs
- SafeNativeMethodsMilCoreApi.cs
- PiiTraceSource.cs
- CodeConditionStatement.cs
- OleDbException.cs
- PassportAuthenticationModule.cs
- XamlUtilities.cs
- UntypedNullExpression.cs
- OutputWindow.cs
- Vector3dCollection.cs
- ScriptControlDescriptor.cs
- ImageListUtils.cs
- FlowStep.cs
- GiveFeedbackEvent.cs
- ArcSegment.cs
- XmlKeywords.cs
- oledbmetadatacolumnnames.cs
- TypeDescriptionProvider.cs
- FilterInvalidBodyAccessException.cs
- SchemaImporter.cs
- CompositeControl.cs
- diagnosticsswitches.cs
- EventManager.cs
- DataMemberListEditor.cs
- ProjectionCamera.cs
- TransformValueSerializer.cs
- Aggregates.cs
- Stacktrace.cs
- NodeLabelEditEvent.cs
- ACE.cs
- RuleRef.cs
- infer.cs
- TimeStampChecker.cs
- CodeRegionDirective.cs
- AccessDataSourceView.cs
- IncrementalHitTester.cs
- RequestResizeEvent.cs
- SubMenuStyleCollection.cs
- CodeIndexerExpression.cs
- ColorConvertedBitmap.cs
- StickyNoteHelper.cs
- Int64KeyFrameCollection.cs
- XamlTreeBuilder.cs
- SqlError.cs
- FixedPageAutomationPeer.cs
- XPathParser.cs
- SystemFonts.cs
- InputReferenceExpression.cs
- SynchronizedDispatch.cs
- DataControlFieldHeaderCell.cs
- TextEditorMouse.cs
- TypeElement.cs
- IisTraceWebEventProvider.cs
- WebConfigurationManager.cs
- DetailsViewRowCollection.cs
- LocalizationComments.cs
- HttpDateParse.cs
- Debug.cs
- MatrixAnimationUsingPath.cs
- PresentationSource.cs
- SR.cs
- InlineUIContainer.cs
- SslStream.cs
- Application.cs
- ScrollItemProviderWrapper.cs
- UnsafeCollabNativeMethods.cs
- UserControl.cs
- XPathPatternParser.cs
- IncrementalHitTester.cs
- PriorityChain.cs
- NamespaceInfo.cs
- SafeFileMapViewHandle.cs
- EntityKeyElement.cs
- RegexWriter.cs
- MetabaseServerConfig.cs
- DataGridViewButtonColumn.cs
- StorageModelBuildProvider.cs
- SafeBitVector32.cs
- ReadOnlyCollectionBase.cs
- UnsafeNativeMethods.cs
- ValidatedControlConverter.cs
- StrokeNodeData.cs
- UMPAttributes.cs
- xsdvalidator.cs
- IChannel.cs
- safelink.cs
- HtmlImage.cs