Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridHeaderBorder.cs
- ActiveXContainer.cs
- ContainerParaClient.cs
- DesignObjectWrapper.cs
- CompModSwitches.cs
- XslNumber.cs
- DataTablePropertyDescriptor.cs
- ConnectionStringsExpressionEditor.cs
- InfoCardHelper.cs
- CompilationRelaxations.cs
- ConnectionPoolManager.cs
- MethodBuilder.cs
- LassoSelectionBehavior.cs
- GCHandleCookieTable.cs
- EntitySetDataBindingList.cs
- MLangCodePageEncoding.cs
- DataViewListener.cs
- WebPartsPersonalizationAuthorization.cs
- AliasExpr.cs
- COM2TypeInfoProcessor.cs
- ContractValidationHelper.cs
- HelpExampleGenerator.cs
- GlobalProxySelection.cs
- URLString.cs
- InvalidAsynchronousStateException.cs
- XPathNavigator.cs
- ArgumentsParser.cs
- TreeIterator.cs
- LinearQuaternionKeyFrame.cs
- XmlTextReaderImpl.cs
- PerfCounterSection.cs
- ButtonFieldBase.cs
- MappingMetadataHelper.cs
- Message.cs
- MainMenu.cs
- DataGridCommandEventArgs.cs
- TaiwanCalendar.cs
- ProtectedConfigurationSection.cs
- RuleSettings.cs
- Calendar.cs
- Adorner.cs
- XmlAttributeProperties.cs
- CodeAttributeArgument.cs
- ThousandthOfEmRealPoints.cs
- ParseHttpDate.cs
- CodeGroup.cs
- IndexedGlyphRun.cs
- MaskedTextBox.cs
- XmlDomTextWriter.cs
- StandardToolWindows.cs
- TextEffectCollection.cs
- PageThemeBuildProvider.cs
- ReferentialConstraintRoleElement.cs
- ReferenceService.cs
- Effect.cs
- IndexedGlyphRun.cs
- DragCompletedEventArgs.cs
- ToolStripPanel.cs
- Atom10FormatterFactory.cs
- Attributes.cs
- PropertyChangingEventArgs.cs
- SeekStoryboard.cs
- IgnoreSectionHandler.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ValueQuery.cs
- InterleavedZipPartStream.cs
- HttpServerUtilityBase.cs
- FtpWebRequest.cs
- Selection.cs
- HtmlInputSubmit.cs
- FileUtil.cs
- Image.cs
- SqlComparer.cs
- CommandBindingCollection.cs
- DescendantQuery.cs
- TimelineCollection.cs
- FilterElement.cs
- FolderBrowserDialog.cs
- XPathDocument.cs
- SearchForVirtualItemEventArgs.cs
- SessionEndingEventArgs.cs
- AttributeInfo.cs
- XslAst.cs
- SwitchElementsCollection.cs
- GridViewPageEventArgs.cs
- UMPAttributes.cs
- MembershipValidatePasswordEventArgs.cs
- SoapIncludeAttribute.cs
- OciLobLocator.cs
- _IPv4Address.cs
- PieceDirectory.cs
- ValidatedControlConverter.cs
- XmlAutoDetectWriter.cs
- DataGridAddNewRow.cs
- ConfigViewGenerator.cs
- FilterQueryOptionExpression.cs
- LayoutSettings.cs
- PrimitiveCodeDomSerializer.cs
- IsolatedStoragePermission.cs
- EpmContentDeSerializer.cs