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
- ListenerHandler.cs
- PaintEvent.cs
- TextRangeBase.cs
- COM2FontConverter.cs
- CompilationPass2TaskInternal.cs
- DbFunctionCommandTree.cs
- StringDictionaryCodeDomSerializer.cs
- FactoryMaker.cs
- RouteParameter.cs
- GetImportFileNameRequest.cs
- PersistenceTypeAttribute.cs
- SqlNamer.cs
- coordinator.cs
- ColumnWidthChangedEvent.cs
- DataListGeneralPage.cs
- ForeignKeyFactory.cs
- Transform.cs
- SafeEventHandle.cs
- AppLevelCompilationSectionCache.cs
- TableHeaderCell.cs
- UncommonField.cs
- QueryComponents.cs
- EntityRecordInfo.cs
- DataRowIndexBuffer.cs
- EventMap.cs
- PartialList.cs
- ControlParameter.cs
- MaskedTextBoxTextEditor.cs
- HitTestParameters3D.cs
- GroupStyle.cs
- MsdtcWrapper.cs
- DbConnectionPoolGroupProviderInfo.cs
- MaskedTextProvider.cs
- SaveFileDialogDesigner.cs
- Metadata.cs
- ResXFileRef.cs
- _NegotiateClient.cs
- TableLayoutStyleCollection.cs
- CommandHelper.cs
- TableLayoutRowStyleCollection.cs
- SqlTrackingQuery.cs
- OrthographicCamera.cs
- DataGridPagerStyle.cs
- DataComponentMethodGenerator.cs
- InstanceContext.cs
- XmlSchemaCompilationSettings.cs
- ServiceCredentials.cs
- XmlSchemaAnnotated.cs
- HttpRequest.cs
- FlowDocumentReaderAutomationPeer.cs
- FormViewDeletedEventArgs.cs
- ListBoxChrome.cs
- SubclassTypeValidatorAttribute.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- OneToOneMappingSerializer.cs
- TableColumn.cs
- PointAnimationBase.cs
- FlowDocumentScrollViewer.cs
- Stroke.cs
- TransactedBatchingElement.cs
- Int32Converter.cs
- QueryParameter.cs
- XmlStreamStore.cs
- TemplateManager.cs
- OracleConnection.cs
- BasicAsyncResult.cs
- CollectionsUtil.cs
- DocumentGrid.cs
- _BaseOverlappedAsyncResult.cs
- PanelStyle.cs
- KeyMatchBuilder.cs
- StorageRoot.cs
- DispatcherObject.cs
- InvokeMethod.cs
- SqlComparer.cs
- ManipulationLogic.cs
- MaterialGroup.cs
- ValueQuery.cs
- DescendantOverDescendantQuery.cs
- ErrorTableItemStyle.cs
- MediaPlayer.cs
- SqlReorderer.cs
- DbParameterHelper.cs
- ByteAnimation.cs
- PropertyDescriptorGridEntry.cs
- InstanceDataCollection.cs
- XmlFormatWriterGenerator.cs
- HtmlElementEventArgs.cs
- MetadataArtifactLoaderCompositeResource.cs
- OracleCommandSet.cs
- ApplicationSecurityInfo.cs
- UpWmlMobileTextWriter.cs
- RefreshPropertiesAttribute.cs
- Compilation.cs
- Vector3DCollection.cs
- BaseProcessProtocolHandler.cs
- SocketPermission.cs
- ValueHandle.cs
- FontInfo.cs
- SqlRowUpdatingEvent.cs