Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TdsParserSessionPool.cs
- XmlToDatasetMap.cs
- UnsafeNativeMethods.cs
- SafeNativeMemoryHandle.cs
- Lasso.cs
- QueryConverter.cs
- Line.cs
- BinaryObjectWriter.cs
- PolyBezierSegment.cs
- NativeObjectSecurity.cs
- storepermissionattribute.cs
- HandlerBase.cs
- HtmlInputRadioButton.cs
- CatalogPartCollection.cs
- PeerNameResolver.cs
- FormatterServices.cs
- SamlAuthorityBinding.cs
- RootBrowserWindow.cs
- GenericPrincipal.cs
- TraceLog.cs
- EventLogConfiguration.cs
- DescriptionCreator.cs
- ApplicationServiceHelper.cs
- DropDownList.cs
- HtmlElement.cs
- VersionedStreamOwner.cs
- TypeContext.cs
- ViewService.cs
- FixedSOMElement.cs
- Shared.cs
- ParallelDesigner.cs
- ComPlusInstanceProvider.cs
- Lasso.cs
- XmlAttributeOverrides.cs
- WebPermission.cs
- CompilerState.cs
- StrongName.cs
- HandlerMappingMemo.cs
- LongValidator.cs
- OutOfMemoryException.cs
- TypographyProperties.cs
- HyperLinkDesigner.cs
- NavigateUrlConverter.cs
- BypassElement.cs
- CodeNamespaceImport.cs
- StylusButtonCollection.cs
- CommonDialog.cs
- OperatorExpressions.cs
- FollowerQueueCreator.cs
- XPathMessageFilter.cs
- AffineTransform3D.cs
- NumberEdit.cs
- MSAAEventDispatcher.cs
- TransactedBatchingBehavior.cs
- ConfigXmlWhitespace.cs
- CodeTypeConstructor.cs
- BitmapData.cs
- Rotation3D.cs
- NamespaceQuery.cs
- DataGridViewEditingControlShowingEventArgs.cs
- MailMessage.cs
- SqlBulkCopy.cs
- ResourceCategoryAttribute.cs
- TraceFilter.cs
- SmtpFailedRecipientsException.cs
- TdsParserStaticMethods.cs
- XmlComplianceUtil.cs
- DocumentPageTextView.cs
- HitTestDrawingContextWalker.cs
- MediaTimeline.cs
- EditorPartCollection.cs
- PackagePart.cs
- InputLanguageManager.cs
- StatusBarItemAutomationPeer.cs
- SqlClientMetaDataCollectionNames.cs
- Visual.cs
- PageCache.cs
- HtmlToClrEventProxy.cs
- _TransmitFileOverlappedAsyncResult.cs
- GroupQuery.cs
- ProfileSettingsCollection.cs
- LogWriteRestartAreaAsyncResult.cs
- ManipulationStartedEventArgs.cs
- LZCodec.cs
- XmlNode.cs
- HashLookup.cs
- NameNode.cs
- BuildResultCache.cs
- Registry.cs
- FileInfo.cs
- NativeMethods.cs
- WSFederationHttpSecurity.cs
- NameService.cs
- RuleInfoComparer.cs
- ConfigXmlDocument.cs
- ModifierKeysConverter.cs
- FatalException.cs
- RecordsAffectedEventArgs.cs
- CancelEventArgs.cs
- IgnoreSectionHandler.cs