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
- LinqDataSourceSelectEventArgs.cs
- FunctionQuery.cs
- RecipientInfo.cs
- COM2ExtendedBrowsingHandler.cs
- AllMembershipCondition.cs
- Hash.cs
- TriState.cs
- PartitionResolver.cs
- DataService.cs
- ObjectViewEntityCollectionData.cs
- KeyConstraint.cs
- ToolStripPanelDesigner.cs
- WorkflowInvoker.cs
- Query.cs
- ListViewGroupConverter.cs
- GB18030Encoding.cs
- ObjectDisposedException.cs
- ETagAttribute.cs
- DataGridPagerStyle.cs
- GeometryHitTestParameters.cs
- SignatureDescription.cs
- ConnectionPoolManager.cs
- DataGridViewRowPrePaintEventArgs.cs
- UnsafeNativeMethods.cs
- SafeCertificateContext.cs
- DataGridViewBindingCompleteEventArgs.cs
- HttpChannelListener.cs
- ControlTemplate.cs
- ByteAnimationBase.cs
- KeyMatchBuilder.cs
- SpellerError.cs
- BlockCollection.cs
- CreateUserWizardStep.cs
- ClientRuntimeConfig.cs
- RootNamespaceAttribute.cs
- ExecutionEngineException.cs
- WebPartAddingEventArgs.cs
- ListenUriMode.cs
- SspiWrapper.cs
- MethodToken.cs
- FrameworkReadOnlyPropertyMetadata.cs
- IndexedString.cs
- XmlValueConverter.cs
- FilteredAttributeCollection.cs
- OleDbWrapper.cs
- VScrollBar.cs
- EntityKeyElement.cs
- ReflectionPermission.cs
- ResourceExpressionBuilder.cs
- RegexCode.cs
- ClientProxyGenerator.cs
- DataGridPagerStyle.cs
- LockedActivityGlyph.cs
- UseAttributeSetsAction.cs
- CodeBlockBuilder.cs
- CopyAttributesAction.cs
- Debug.cs
- CursorConverter.cs
- UInt64.cs
- UrlMappingsSection.cs
- WindowsListViewGroupSubsetLink.cs
- BadImageFormatException.cs
- XmlBoundElement.cs
- DynamicDataRouteHandler.cs
- StorageAssociationTypeMapping.cs
- CompilerScope.cs
- SiteMapDataSourceView.cs
- MetadataUtil.cs
- PagerSettings.cs
- RangeBase.cs
- SHA1Managed.cs
- IFlowDocumentViewer.cs
- HttpListenerRequest.cs
- Schedule.cs
- FormatVersion.cs
- CreatingCookieEventArgs.cs
- DbDataAdapter.cs
- SqlSelectClauseBuilder.cs
- XmlSchemaAttributeGroupRef.cs
- MsmqIntegrationProcessProtocolHandler.cs
- DataTableMappingCollection.cs
- HttpCookiesSection.cs
- wgx_sdk_version.cs
- RenderTargetBitmap.cs
- FixedPosition.cs
- CqlIdentifiers.cs
- RegisteredExpandoAttribute.cs
- XmlNode.cs
- BoolLiteral.cs
- SqlMethodTransformer.cs
- DrawingBrush.cs
- XmlAttributes.cs
- ListBindableAttribute.cs
- DbDataRecord.cs
- UIAgentAsyncEndRequest.cs
- XsdBuilder.cs
- GridViewUpdateEventArgs.cs
- MachineKeyConverter.cs
- RegisteredArrayDeclaration.cs
- ListViewUpdateEventArgs.cs