Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- OleDbDataAdapter.cs
- DataRelationCollection.cs
- COAUTHINFO.cs
- AccessDataSource.cs
- NetworkStream.cs
- WpfWebRequestHelper.cs
- GridSplitterAutomationPeer.cs
- BitmapPalettes.cs
- Pen.cs
- ComponentSerializationService.cs
- Number.cs
- AspNetHostingPermission.cs
- HostSecurityManager.cs
- OrderedDictionary.cs
- FontDriver.cs
- ModelUtilities.cs
- InvalidEnumArgumentException.cs
- SrgsElementFactory.cs
- CheckBoxStandardAdapter.cs
- XsltInput.cs
- SineEase.cs
- LineInfo.cs
- PrinterSettings.cs
- contentDescriptor.cs
- TextElementAutomationPeer.cs
- DesignerCategoryAttribute.cs
- KeyConverter.cs
- SamlAssertion.cs
- complextypematerializer.cs
- FontWeight.cs
- ImageSourceValueSerializer.cs
- ScrollBar.cs
- ActivityMetadata.cs
- PerformanceCounterLib.cs
- CoTaskMemHandle.cs
- ResourceContainer.cs
- ReadContentAsBinaryHelper.cs
- ToolboxItemCollection.cs
- DesignerToolStripControlHost.cs
- WarningException.cs
- StorageEntityTypeMapping.cs
- CustomLineCap.cs
- errorpatternmatcher.cs
- newinstructionaction.cs
- _BufferOffsetSize.cs
- SafeNativeMethods.cs
- AssemblyNameProxy.cs
- RegistryKey.cs
- SynchronizedDispatch.cs
- HasCopySemanticsAttribute.cs
- CodeFieldReferenceExpression.cs
- Converter.cs
- ObjectStorage.cs
- SectionUpdates.cs
- Socket.cs
- MatrixAnimationBase.cs
- ElementProxy.cs
- OracleDateTime.cs
- ColorTransform.cs
- DetailsViewRow.cs
- DataGrid.cs
- ValueChangedEventManager.cs
- EntityProviderFactory.cs
- AsymmetricSignatureFormatter.cs
- ServiceHostFactory.cs
- StreamGeometry.cs
- AnchoredBlock.cs
- sqlstateclientmanager.cs
- PrintDialog.cs
- HttpContextServiceHost.cs
- DesignerEventService.cs
- TextSelectionHighlightLayer.cs
- WhereQueryOperator.cs
- RadioButtonList.cs
- Array.cs
- TransformGroup.cs
- TemplateBindingExtensionConverter.cs
- odbcmetadatacollectionnames.cs
- ListViewPagedDataSource.cs
- PenContext.cs
- Context.cs
- DbReferenceCollection.cs
- AppSettingsExpressionBuilder.cs
- AsyncWaitHandle.cs
- DependencyPropertyChangedEventArgs.cs
- TableLayoutPanel.cs
- WarningException.cs
- unsafenativemethodstextservices.cs
- SendActivityValidator.cs
- newinstructionaction.cs
- WaitForChangedResult.cs
- MulticastDelegate.cs
- Quad.cs
- dbenumerator.cs
- FontWeight.cs
- StaticFileHandler.cs
- AddInActivator.cs
- DiagnosticsElement.cs
- DriveInfo.cs
- XPathSelectionIterator.cs