Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Base / MS / Internal / ComponentModel / PropertyKey.cs / 1 / 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
- BaseCollection.cs
- EnumType.cs
- KeyboardDevice.cs
- FamilyTypefaceCollection.cs
- SQLUtility.cs
- AbstractDataSvcMapFileLoader.cs
- ExtendedProtectionPolicyTypeConverter.cs
- MobileRedirect.cs
- AssemblyCache.cs
- WorkflowApplicationException.cs
- GeometryDrawing.cs
- _Connection.cs
- WorkflowRuntime.cs
- EmptyEnumerator.cs
- EntityContainerEmitter.cs
- SchemaCollectionPreprocessor.cs
- PropertyExpression.cs
- HandlerWithFactory.cs
- VBCodeProvider.cs
- Classification.cs
- HTMLTextWriter.cs
- TreeNodeConverter.cs
- TemplateKeyConverter.cs
- DataGridViewRowCancelEventArgs.cs
- WmlFormAdapter.cs
- ToolStripItemCollection.cs
- SqlProfileProvider.cs
- CardSpaceSelector.cs
- ToolStripPanelCell.cs
- ResourceReferenceKeyNotFoundException.cs
- TransportListener.cs
- RectAnimation.cs
- XmlQueryType.cs
- QuaternionRotation3D.cs
- IApplicationTrustManager.cs
- DataGridViewComponentPropertyGridSite.cs
- DataGridPageChangedEventArgs.cs
- SecurityPermission.cs
- TransformerInfo.cs
- DataGridTableCollection.cs
- OutputWindow.cs
- GridViewSortEventArgs.cs
- MappingModelBuildProvider.cs
- SafeArrayRankMismatchException.cs
- DataControlPagerLinkButton.cs
- ClientRuntimeConfig.cs
- NamespaceInfo.cs
- CompoundFileStreamReference.cs
- StringUtil.cs
- WindowsGraphics.cs
- COSERVERINFO.cs
- SurrogateEncoder.cs
- DataGridAddNewRow.cs
- WindowsUpDown.cs
- OutOfMemoryException.cs
- XmlSchemaProviderAttribute.cs
- ControlHelper.cs
- GetWinFXPath.cs
- StyleXamlTreeBuilder.cs
- DefaultEventAttribute.cs
- PrintPageEvent.cs
- DNS.cs
- XmlCharCheckingWriter.cs
- IInstanceContextProvider.cs
- TextModifierScope.cs
- ResXResourceReader.cs
- PageThemeBuildProvider.cs
- SafeFileMappingHandle.cs
- BindingNavigatorDesigner.cs
- NavigationProgressEventArgs.cs
- XsdCachingReader.cs
- codemethodreferenceexpression.cs
- DataGridViewAutoSizeModeEventArgs.cs
- FrameworkContentElement.cs
- AnonymousIdentificationModule.cs
- TargetConverter.cs
- XmlLangPropertyAttribute.cs
- EpmTargetTree.cs
- AliasGenerator.cs
- columnmapfactory.cs
- RegisteredScript.cs
- TriggerCollection.cs
- ListItem.cs
- PtsContext.cs
- ObjectNotFoundException.cs
- StateChangeEvent.cs
- PenLineJoinValidation.cs
- DropDownList.cs
- NgenServicingAttributes.cs
- SafeBitVector32.cs
- AssociationTypeEmitter.cs
- FixedFlowMap.cs
- StandardBindingImporter.cs
- ComponentCodeDomSerializer.cs
- GenericTextProperties.cs
- Globals.cs
- BackStopAuthenticationModule.cs
- ScrollContentPresenter.cs
- SerializationUtility.cs
- TextDecorationUnitValidation.cs