Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / ComponentModel / PropertyKey.cs / 1305600 / PropertyKey.cs
namespace MS.Internal.ComponentModel { using System; using System.Collections.Generic; using System.Windows; // This structure is used as a key in a dictionary of property key -> property descriptor // The key is unique based on the type the property is attached to, and the property // itself. internal struct PropertyKey : IEquatable{ internal PropertyKey(Type attachedType, DependencyProperty prop) { DependencyProperty = prop; AttachedType = attachedType; _hashCode = AttachedType.GetHashCode() ^ DependencyProperty.GetHashCode(); } public override int GetHashCode() { return _hashCode; } public override bool Equals(object obj) { return Equals((PropertyKey)obj); } public bool Equals(PropertyKey key) { return (key.AttachedType == AttachedType && key.DependencyProperty == DependencyProperty); } public static bool operator ==(PropertyKey key1, PropertyKey key2) { return (key1.AttachedType == key2.AttachedType && key1.DependencyProperty == key2.DependencyProperty); } public static bool operator !=(PropertyKey key1, PropertyKey key2) { return (key1.AttachedType != key2.AttachedType || key1.DependencyProperty != key2.DependencyProperty); } internal DependencyProperty DependencyProperty; internal Type AttachedType; private int _hashCode; } } // 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.Collections.Generic; using System.Windows; // This structure is used as a key in a dictionary of property key -> property descriptor // The key is unique based on the type the property is attached to, and the property // itself. internal struct PropertyKey : IEquatable { internal PropertyKey(Type attachedType, DependencyProperty prop) { DependencyProperty = prop; AttachedType = attachedType; _hashCode = AttachedType.GetHashCode() ^ DependencyProperty.GetHashCode(); } public override int GetHashCode() { return _hashCode; } public override bool Equals(object obj) { return Equals((PropertyKey)obj); } public bool Equals(PropertyKey key) { return (key.AttachedType == AttachedType && key.DependencyProperty == DependencyProperty); } public static bool operator ==(PropertyKey key1, PropertyKey key2) { return (key1.AttachedType == key2.AttachedType && key1.DependencyProperty == key2.DependencyProperty); } public static bool operator !=(PropertyKey key1, PropertyKey key2) { return (key1.AttachedType != key2.AttachedType || key1.DependencyProperty != key2.DependencyProperty); } internal DependencyProperty DependencyProperty; internal Type AttachedType; private int _hashCode; } } // 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
- Boolean.cs
- EventLogPermissionEntryCollection.cs
- MonthCalendar.cs
- ArgumentException.cs
- Opcode.cs
- ModelProperty.cs
- SHA384CryptoServiceProvider.cs
- IntSecurity.cs
- VersionConverter.cs
- COMException.cs
- cryptoapiTransform.cs
- AppliedDeviceFiltersDialog.cs
- FunctionUpdateCommand.cs
- CookielessHelper.cs
- IsolatedStoragePermission.cs
- PolicyException.cs
- SkinBuilder.cs
- BitmapEffectGroup.cs
- InheritanceUI.cs
- CodeDOMUtility.cs
- SspiWrapper.cs
- BuildProvidersCompiler.cs
- SchemaDeclBase.cs
- FileIOPermission.cs
- PersonalizationStateQuery.cs
- Token.cs
- CompModSwitches.cs
- MetadataStore.cs
- AutomationElementCollection.cs
- Crypto.cs
- TileBrush.cs
- DBParameter.cs
- DataComponentGenerator.cs
- ObjectStateEntry.cs
- SoapHeaders.cs
- DrawToolTipEventArgs.cs
- BrowserCapabilitiesCompiler.cs
- DataControlFieldCollection.cs
- NextPreviousPagerField.cs
- CacheDependency.cs
- RangeValuePattern.cs
- SafeNativeMethodsMilCoreApi.cs
- ListenerConnectionModeReader.cs
- SqlMetaData.cs
- MiniLockedBorderGlyph.cs
- Rss20FeedFormatter.cs
- DbReferenceCollection.cs
- PartialTrustHelpers.cs
- DesignerCategoryAttribute.cs
- XmlUtilWriter.cs
- CodePageEncoding.cs
- GeneralTransformGroup.cs
- StreamReader.cs
- DesignTimeData.cs
- TableHeaderCell.cs
- XpsS0ValidatingLoader.cs
- TableLayoutStyle.cs
- VerificationException.cs
- UmAlQuraCalendar.cs
- XmlC14NWriter.cs
- HtmlTable.cs
- StateMachineSubscription.cs
- Literal.cs
- SmiContext.cs
- SecuritySessionFilter.cs
- ToolTip.cs
- EdmFunction.cs
- PrintDialog.cs
- AtomicFile.cs
- IsolatedStorageFile.cs
- SamlAssertionKeyIdentifierClause.cs
- RuleProcessor.cs
- UniqueIdentifierService.cs
- HttpListener.cs
- SourceFileInfo.cs
- Validator.cs
- CustomWebEventKey.cs
- EdmEntityTypeAttribute.cs
- RegisteredArrayDeclaration.cs
- SqlDataSourceStatusEventArgs.cs
- Authorization.cs
- nulltextcontainer.cs
- ViewLoader.cs
- ThreadAbortException.cs
- ConnectionsZone.cs
- KeyboardNavigation.cs
- NonceToken.cs
- WebPartCatalogCloseVerb.cs
- dsa.cs
- WindowsBrush.cs
- DataSetFieldSchema.cs
- EmptyStringExpandableObjectConverter.cs
- StrongNameIdentityPermission.cs
- ObjectView.cs
- DocobjHost.cs
- columnmapfactory.cs
- CategoryAttribute.cs
- StringPropertyBuilder.cs
- GridPattern.cs
- ObjectListCommandsPage.cs