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
- JsonFormatReaderGenerator.cs
- Cursor.cs
- SuppressIldasmAttribute.cs
- DataSysAttribute.cs
- TransformerInfo.cs
- ToolboxItemAttribute.cs
- HttpListenerContext.cs
- RuleSettings.cs
- EntityDataSourceContainerNameConverter.cs
- XmlKeywords.cs
- PasswordTextNavigator.cs
- WindowsAuthenticationModule.cs
- DataGridBeginningEditEventArgs.cs
- dsa.cs
- AssemblyBuilderData.cs
- GroupQuery.cs
- DesignerOptions.cs
- DesignerLoader.cs
- Point3DCollection.cs
- FormatterServices.cs
- AssemblyCache.cs
- SelectionItemPattern.cs
- StrongNameKeyPair.cs
- _ConnectionGroup.cs
- PeerCredentialElement.cs
- RuleConditionDialog.cs
- PbrsForward.cs
- ExpressionBinding.cs
- OrthographicCamera.cs
- Geometry3D.cs
- GenericsInstances.cs
- ContextInformation.cs
- DecodeHelper.cs
- WebPartManagerDesigner.cs
- TCPListener.cs
- HtmlListAdapter.cs
- GenericWebPart.cs
- Calendar.cs
- Opcode.cs
- HTMLTagNameToTypeMapper.cs
- PTProvider.cs
- XmlAttributeAttribute.cs
- TextBreakpoint.cs
- Label.cs
- MouseWheelEventArgs.cs
- WhileDesigner.cs
- ValueTable.cs
- PiiTraceSource.cs
- DrawItemEvent.cs
- ConfigurationProperty.cs
- ClrProviderManifest.cs
- ScriptModule.cs
- OleDbStruct.cs
- XmlSchemaAttribute.cs
- CryptoApi.cs
- ServicePoint.cs
- PrimitiveType.cs
- Switch.cs
- SuppressMessageAttribute.cs
- AccessText.cs
- Compress.cs
- SqlXml.cs
- EntityTypeBase.cs
- SplayTreeNode.cs
- DBCSCodePageEncoding.cs
- DesignerActionGlyph.cs
- WebBrowserContainer.cs
- BindableAttribute.cs
- TakeQueryOptionExpression.cs
- RemoteWebConfigurationHostServer.cs
- ClientApiGenerator.cs
- GridViewSortEventArgs.cs
- CurrencyWrapper.cs
- UIPropertyMetadata.cs
- lengthconverter.cs
- PersistenceTypeAttribute.cs
- X509PeerCertificateElement.cs
- ToolZone.cs
- VolatileEnlistmentMultiplexing.cs
- ListViewGroupItemCollection.cs
- GC.cs
- NonSerializedAttribute.cs
- Inflater.cs
- NullableConverter.cs
- CheckBox.cs
- EntityContainer.cs
- GridViewUpdateEventArgs.cs
- UriScheme.cs
- ArgumentException.cs
- AnnotationObservableCollection.cs
- WebPartsPersonalization.cs
- DataGridCellItemAutomationPeer.cs
- SecurityManager.cs
- ListViewCancelEventArgs.cs
- HwndSource.cs
- AmbientLight.cs
- externdll.cs
- HostingEnvironmentSection.cs
- VirtualPath.cs
- CompilerHelpers.cs