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
- StreamInfo.cs
- Single.cs
- PiiTraceSource.cs
- IdlingCommunicationPool.cs
- StrokeCollectionDefaultValueFactory.cs
- CollectionView.cs
- HostingMessageProperty.cs
- CodeTypeReferenceExpression.cs
- Variable.cs
- DataGridViewCellStyleConverter.cs
- JavaScriptString.cs
- ViewBox.cs
- CodeSubDirectoriesCollection.cs
- RequestCacheEntry.cs
- KerberosTicketHashIdentifierClause.cs
- SSmlParser.cs
- SemanticResultValue.cs
- Configuration.cs
- XPathScanner.cs
- DetailsView.cs
- CodeMemberProperty.cs
- PreviewPageInfo.cs
- remotingproxy.cs
- ToolboxComponentsCreatingEventArgs.cs
- FunctionQuery.cs
- MethodBuilder.cs
- CodeDomSerializer.cs
- PhonemeConverter.cs
- NetTcpSection.cs
- _ScatterGatherBuffers.cs
- SqlCacheDependency.cs
- List.cs
- DependencyPropertyHelper.cs
- HttpConfigurationSystem.cs
- FunctionImportMapping.cs
- WsatTransactionFormatter.cs
- CdpEqualityComparer.cs
- HorizontalAlignConverter.cs
- BamlLocalizationDictionary.cs
- SoapSchemaMember.cs
- OleDbParameterCollection.cs
- WinFormsComponentEditor.cs
- ProviderConnectionPoint.cs
- Peer.cs
- DataSpaceManager.cs
- LabelAutomationPeer.cs
- Encoding.cs
- HtmlMeta.cs
- AngleUtil.cs
- ByteConverter.cs
- CustomErrorCollection.cs
- SID.cs
- Delegate.cs
- SemaphoreSecurity.cs
- GetRecipientRequest.cs
- SourceElementsCollection.cs
- SamlConditions.cs
- AutomationPatternInfo.cs
- WebScriptMetadataFormatter.cs
- glyphs.cs
- XmlQueryRuntime.cs
- GridViewColumnHeaderAutomationPeer.cs
- FixedBufferAttribute.cs
- FormViewAutoFormat.cs
- DataGridItemCollection.cs
- HtmlShim.cs
- FileUtil.cs
- xml.cs
- ProfilePropertySettingsCollection.cs
- XmlNamespaceMapping.cs
- RelationshipConstraintValidator.cs
- RectAnimationClockResource.cs
- WindowInteractionStateTracker.cs
- ResizingMessageFilter.cs
- NavigatingCancelEventArgs.cs
- XmlLinkedNode.cs
- Activity.cs
- TypeConverters.cs
- DateTimeOffset.cs
- BaseCollection.cs
- WinEventHandler.cs
- FormDocumentDesigner.cs
- MachineKey.cs
- RuntimeEnvironment.cs
- QilDataSource.cs
- SafeTokenHandle.cs
- DbMetaDataCollectionNames.cs
- NonClientArea.cs
- Style.cs
- CanonicalXml.cs
- EncryptedHeaderXml.cs
- HwndMouseInputProvider.cs
- ConfigXmlElement.cs
- HtmlInputText.cs
- StatusBarItemAutomationPeer.cs
- TypeDescriptorFilterService.cs
- WebPartChrome.cs
- HebrewNumber.cs
- ImageCodecInfo.cs
- LinearGradientBrush.cs