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
- Cursor.cs
- ScrollViewerAutomationPeer.cs
- RegexCapture.cs
- CompoundFileStorageReference.cs
- ControlPaint.cs
- SelectionItemPattern.cs
- ProxyWebPartConnectionCollection.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- coordinatorfactory.cs
- ASCIIEncoding.cs
- Fonts.cs
- StatusBarPanel.cs
- EndpointDesigner.cs
- AspNetCompatibilityRequirementsAttribute.cs
- PasswordRecovery.cs
- FileDialog.cs
- HtmlInputCheckBox.cs
- JoinSymbol.cs
- BinaryCommonClasses.cs
- _SingleItemRequestCache.cs
- TextMarkerSource.cs
- UrlAuthFailureHandler.cs
- TreeWalkHelper.cs
- AnnotationHelper.cs
- NamespaceMapping.cs
- _ShellExpression.cs
- _TimerThread.cs
- DataGridItemCollection.cs
- SpecularMaterial.cs
- UniqueID.cs
- SqlDataSourceSelectingEventArgs.cs
- EpmContentDeSerializer.cs
- DrawingBrush.cs
- ConfigurationSettings.cs
- VirtualDirectoryMapping.cs
- WebPartTransformer.cs
- DataList.cs
- ErrorHandler.cs
- Accessible.cs
- RootProfilePropertySettingsCollection.cs
- MetadataItemEmitter.cs
- SystemEvents.cs
- InvalidOperationException.cs
- AnnotationDocumentPaginator.cs
- ValueProviderWrapper.cs
- SlotInfo.cs
- SafeNativeMethods.cs
- SrgsDocument.cs
- RolePrincipal.cs
- WebPartConnectionsCancelEventArgs.cs
- ObjectTag.cs
- BindingCompleteEventArgs.cs
- SafeNativeMethods.cs
- ProfileService.cs
- HwndSourceKeyboardInputSite.cs
- NetPeerTcpBindingElement.cs
- XmlSchemaSimpleTypeList.cs
- MetadataArtifactLoaderFile.cs
- BitmapData.cs
- ValidateNames.cs
- DataReceivedEventArgs.cs
- ConfigXmlCDataSection.cs
- AsyncOperationContext.cs
- ConstrainedGroup.cs
- WSSecurityPolicy12.cs
- DesignerSerializerAttribute.cs
- XmlSerializerAssemblyAttribute.cs
- PartEditor.cs
- RotationValidation.cs
- XsltException.cs
- BrowserCapabilitiesFactory35.cs
- NotImplementedException.cs
- FontCacheUtil.cs
- StringCollection.cs
- TextStore.cs
- ProfileSettingsCollection.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- CreateSequence.cs
- OdbcInfoMessageEvent.cs
- WindowsUpDown.cs
- WebPartDisplayModeEventArgs.cs
- ChannelSettingsElement.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- ChtmlSelectionListAdapter.cs
- DefaultWorkflowLoaderService.cs
- DependencyObjectPropertyDescriptor.cs
- TripleDESCryptoServiceProvider.cs
- ScriptingRoleServiceSection.cs
- SecurityManager.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- TwoPhaseCommit.cs
- IgnoreFileBuildProvider.cs
- SID.cs
- CryptoApi.cs
- StartUpEventArgs.cs
- ClusterRegistryConfigurationProvider.cs
- baseaxisquery.cs
- DataGridTableCollection.cs
- RepeaterItem.cs
- LicFileLicenseProvider.cs