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
- _DigestClient.cs
- LinkDescriptor.cs
- XmlSubtreeReader.cs
- shaperfactoryquerycachekey.cs
- ColumnResizeAdorner.cs
- EmbeddedObject.cs
- BookmarkEventArgs.cs
- DataRelation.cs
- WorkflowOperationErrorHandler.cs
- KeyFrames.cs
- RoleService.cs
- SoapFault.cs
- PolicyLevel.cs
- Stackframe.cs
- ResolveMatchesCD1.cs
- DocumentOrderQuery.cs
- DataGridViewCellStyle.cs
- TrackBar.cs
- ApplicationDirectory.cs
- ClientData.cs
- FilterEventArgs.cs
- rsa.cs
- SiteMapNodeCollection.cs
- WebBaseEventKeyComparer.cs
- Viewport3DVisual.cs
- XmlDataCollection.cs
- Rotation3D.cs
- HttpListenerException.cs
- XmlSequenceWriter.cs
- MimeFormImporter.cs
- SqlUtils.cs
- BaseContextMenu.cs
- WmlPhoneCallAdapter.cs
- RuntimeUtils.cs
- Catch.cs
- LOSFormatter.cs
- ByteConverter.cs
- VScrollBar.cs
- RawUIStateInputReport.cs
- SystemNetHelpers.cs
- VectorKeyFrameCollection.cs
- PageCodeDomTreeGenerator.cs
- SessionPageStateSection.cs
- PersonalizationProviderHelper.cs
- Literal.cs
- SQLMoneyStorage.cs
- ReplacementText.cs
- FieldDescriptor.cs
- ProviderUtil.cs
- XmlSchemaAppInfo.cs
- SqlMultiplexer.cs
- BuildProviderAppliesToAttribute.cs
- XmlCharCheckingWriter.cs
- Baml2006Reader.cs
- TableAutomationPeer.cs
- prefixendpointaddressmessagefiltertable.cs
- SqlUserDefinedAggregateAttribute.cs
- HttpClientCertificate.cs
- CharacterHit.cs
- TCEAdapterGenerator.cs
- UIElementParagraph.cs
- DetailsViewPagerRow.cs
- BaseAsyncResult.cs
- embossbitmapeffect.cs
- ApplicationContext.cs
- XmlAnyElementAttribute.cs
- WindowsGraphicsCacheManager.cs
- PermissionToken.cs
- ToolTipService.cs
- InfoCardProofToken.cs
- LinkDesigner.cs
- CompilerScopeManager.cs
- XmlParserContext.cs
- remotingproxy.cs
- XDeferredAxisSource.cs
- PenLineCapValidation.cs
- COAUTHINFO.cs
- CompensationExtension.cs
- QueryStringParameter.cs
- OleDbConnection.cs
- Permission.cs
- DiscoveryReferences.cs
- PreloadedPackages.cs
- RewritingSimplifier.cs
- DesignerRegion.cs
- GradientStop.cs
- FontWeight.cs
- Scene3D.cs
- KnownTypeHelper.cs
- ListParagraph.cs
- FileDialogCustomPlacesCollection.cs
- OracleDataAdapter.cs
- serverconfig.cs
- SqlUserDefinedTypeAttribute.cs
- ProcessThreadCollection.cs
- WhitespaceRuleReader.cs
- SqlConnectionPoolGroupProviderInfo.cs
- TextEditor.cs
- XpsViewerException.cs
- EndEvent.cs