Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / ComponentModel / DependencyPropertyAttribute.cs / 1305600 / 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
- WeakHashtable.cs
- MarkupCompilePass1.cs
- IImplicitResourceProvider.cs
- peersecuritysettings.cs
- RayMeshGeometry3DHitTestResult.cs
- XPathItem.cs
- ArraySortHelper.cs
- FieldDescriptor.cs
- PermissionSetEnumerator.cs
- BasicBrowserDialog.cs
- UshortList2.cs
- PriorityItem.cs
- ValidateNames.cs
- MoveSizeWinEventHandler.cs
- parserscommon.cs
- WindowsFont.cs
- SQLMoney.cs
- PrintPreviewGraphics.cs
- AutomationPatternInfo.cs
- InfiniteTimeSpanConverter.cs
- OleDbCommandBuilder.cs
- Property.cs
- DispatcherHookEventArgs.cs
- TdsParameterSetter.cs
- LocalFileSettingsProvider.cs
- EndpointBehaviorElement.cs
- XappLauncher.cs
- COM2ExtendedBrowsingHandler.cs
- XmlNodeReader.cs
- LockedAssemblyCache.cs
- CmsInterop.cs
- FontConverter.cs
- storepermissionattribute.cs
- UpdatePanelControlTrigger.cs
- PolicyStatement.cs
- XmlDictionaryReaderQuotasElement.cs
- DrawingCollection.cs
- CodeTypeParameter.cs
- RewritingPass.cs
- PromptBuilder.cs
- IdentityModelStringsVersion1.cs
- SchemaNotation.cs
- _FtpControlStream.cs
- LassoHelper.cs
- StoreContentChangedEventArgs.cs
- SerializableAttribute.cs
- DependencyPropertyKey.cs
- QuaternionRotation3D.cs
- GorillaCodec.cs
- EnglishPluralizationService.cs
- ToolStripPanelRenderEventArgs.cs
- ZoneButton.cs
- XmlReflectionImporter.cs
- JsonEncodingStreamWrapper.cs
- XNameTypeConverter.cs
- ProxyGenerationError.cs
- ConfigurationSettings.cs
- OpenTypeCommon.cs
- ProfessionalColors.cs
- SafeRightsManagementSessionHandle.cs
- OdbcStatementHandle.cs
- ConfigurationLocation.cs
- ResumeStoryboard.cs
- HttpAsyncResult.cs
- DocumentCollection.cs
- FeatureManager.cs
- DecoderNLS.cs
- TemplateColumn.cs
- XmlSchemaComplexType.cs
- SqlLiftWhereClauses.cs
- AudioFileOut.cs
- CommunicationException.cs
- PersonalizablePropertyEntry.cs
- SettingsProperty.cs
- LicenseContext.cs
- GroupDescription.cs
- QueryContinueDragEvent.cs
- ObjectDataSourceFilteringEventArgs.cs
- ExpressionEditorSheet.cs
- DataBinding.cs
- SystemResourceKey.cs
- SafeSerializationManager.cs
- AuthenticatedStream.cs
- ResolveCriteriaApril2005.cs
- GradientStop.cs
- MimeTextImporter.cs
- Guid.cs
- Misc.cs
- ServiceDescriptionReflector.cs
- mediaclock.cs
- HandleCollector.cs
- UIAgentInitializationException.cs
- AutoResizedEvent.cs
- SoapParser.cs
- PrintPreviewControl.cs
- ChangePassword.cs
- BinaryParser.cs
- RequestQueue.cs
- InvalidEnumArgumentException.cs
- MachineKeyValidationConverter.cs