Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- AccessDataSource.cs
- InstanceLockLostException.cs
- TreeViewEvent.cs
- HandlerFactoryWrapper.cs
- GrowingArray.cs
- DocComment.cs
- ValueExpressions.cs
- ConfigXmlSignificantWhitespace.cs
- ChannelTerminatedException.cs
- RSAProtectedConfigurationProvider.cs
- DocumentSchemaValidator.cs
- TemplateControl.cs
- WindowPattern.cs
- BinaryObjectInfo.cs
- ToolStripComboBox.cs
- BitmapPalette.cs
- FileEnumerator.cs
- CodeAttributeArgument.cs
- ListViewEditEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- XmlArrayItemAttribute.cs
- SqlCacheDependencyDatabaseCollection.cs
- TextServicesHost.cs
- PairComparer.cs
- JsonReader.cs
- DoubleConverter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- BuilderElements.cs
- objectquery_tresulttype.cs
- MatrixAnimationBase.cs
- LeftCellWrapper.cs
- ForeignConstraint.cs
- HttpServerVarsCollection.cs
- ModelPropertyCollectionImpl.cs
- DataSourceView.cs
- AppSettingsExpressionBuilder.cs
- Nullable.cs
- DurableInstanceProvider.cs
- ExpressionBindingCollection.cs
- CaseStatementSlot.cs
- FixedTextView.cs
- FormatSettings.cs
- SafeCancelMibChangeNotify.cs
- InputBinding.cs
- DesignTimeParseData.cs
- MessageAction.cs
- KnownTypeHelper.cs
- ServiceParser.cs
- ProviderConnectionPoint.cs
- DataGridColumnCollectionEditor.cs
- Metafile.cs
- DocumentViewer.cs
- DLinqColumnProvider.cs
- _NtlmClient.cs
- HtmlTextArea.cs
- COM2EnumConverter.cs
- SpecularMaterial.cs
- DatagridviewDisplayedBandsData.cs
- XmlJsonReader.cs
- ThemeDirectoryCompiler.cs
- PathParser.cs
- DataPagerFieldItem.cs
- ObjectDataSourceSelectingEventArgs.cs
- NetworkStream.cs
- IISMapPath.cs
- KeyEventArgs.cs
- SecurityKeyIdentifier.cs
- FontCacheUtil.cs
- PenLineCapValidation.cs
- ProcessModuleCollection.cs
- ListViewGroup.cs
- XmlIlGenerator.cs
- ISAPIWorkerRequest.cs
- DataColumnMappingCollection.cs
- Metadata.cs
- CompiledWorkflowDefinitionContext.cs
- DefaultTypeArgumentAttribute.cs
- HandlerBase.cs
- ObjectMemberMapping.cs
- SqlInternalConnection.cs
- Assert.cs
- complextypematerializer.cs
- OpenFileDialog.cs
- RemotingAttributes.cs
- SqlCommand.cs
- OledbConnectionStringbuilder.cs
- GridSplitterAutomationPeer.cs
- HtmlInputButton.cs
- SchemeSettingElement.cs
- SoapCodeExporter.cs
- RemoteArgument.cs
- FindResponse.cs
- SoapSchemaImporter.cs
- ImportFileRequest.cs
- ImageField.cs
- MethodBuilderInstantiation.cs
- ColorContext.cs
- FileUtil.cs
- CultureSpecificStringDictionary.cs
- SoapTypeAttribute.cs