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
- ListBoxItemAutomationPeer.cs
- Oid.cs
- DataGridCommandEventArgs.cs
- SimpleMailWebEventProvider.cs
- TypeGeneratedEventArgs.cs
- SpecialFolderEnumConverter.cs
- SimpleHandlerFactory.cs
- ToolboxItemCollection.cs
- Baml6ConstructorInfo.cs
- HtmlInputHidden.cs
- FileDialog_Vista.cs
- MediaPlayerState.cs
- XmlIlGenerator.cs
- XslVisitor.cs
- PromptBuilder.cs
- WebReferencesBuildProvider.cs
- ContractMapping.cs
- XPathNodeInfoAtom.cs
- EmptyEnumerator.cs
- GPPOINT.cs
- ModifierKeysConverter.cs
- X509SubjectKeyIdentifierClause.cs
- SqlServer2KCompatibilityCheck.cs
- TextSelection.cs
- NegotiationTokenAuthenticatorStateCache.cs
- CssStyleCollection.cs
- WebColorConverter.cs
- DbConnectionPoolCounters.cs
- SafeWaitHandle.cs
- QuaternionAnimation.cs
- OdbcErrorCollection.cs
- TabItemWrapperAutomationPeer.cs
- OneToOneMappingSerializer.cs
- NameObjectCollectionBase.cs
- SimpleTableProvider.cs
- PeerUnsafeNativeMethods.cs
- DetailsViewUpdateEventArgs.cs
- ListCollectionView.cs
- UnionQueryOperator.cs
- NameSpaceExtractor.cs
- DataSourceXmlAttributeAttribute.cs
- EncryptRequest.cs
- SharedConnectionWorkflowTransactionService.cs
- DataViewListener.cs
- JulianCalendar.cs
- SemaphoreSecurity.cs
- Opcode.cs
- XmlSchemaExporter.cs
- XappLauncher.cs
- URLMembershipCondition.cs
- ContentHostHelper.cs
- CompoundFileDeflateTransform.cs
- ContractMapping.cs
- ClientUrlResolverWrapper.cs
- DataGridTable.cs
- SiteMapSection.cs
- UriTemplateClientFormatter.cs
- OracleInternalConnection.cs
- ListBoxDesigner.cs
- WebBrowser.cs
- ExtensionQuery.cs
- GlyphRunDrawing.cs
- OleDbStruct.cs
- MessageTraceRecord.cs
- DataGridViewMethods.cs
- cookiecontainer.cs
- LambdaCompiler.Unary.cs
- IndexedString.cs
- ControlBuilderAttribute.cs
- TrustLevelCollection.cs
- OdbcConnectionPoolProviderInfo.cs
- WrappingXamlSchemaContext.cs
- RectValueSerializer.cs
- MsmqProcessProtocolHandler.cs
- FilteredAttributeCollection.cs
- ScriptModule.cs
- XmlSchemaInfo.cs
- SelectionListDesigner.cs
- XmlSchemaExporter.cs
- MultiSelectRootGridEntry.cs
- XPathNodeIterator.cs
- XhtmlBasicTextBoxAdapter.cs
- HitTestResult.cs
- SQLInt32.cs
- ChangeNode.cs
- MenuItem.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- WeakHashtable.cs
- NameTable.cs
- columnmapkeybuilder.cs
- ResourcesBuildProvider.cs
- TextRangeEditTables.cs
- XmlSchemaSimpleContent.cs
- EdmProperty.cs
- DefinitionUpdate.cs
- CollaborationHelperFunctions.cs
- DragEvent.cs
- DurableInstanceProvider.cs
- EpmTargetPathSegment.cs
- ProxyWebPartManager.cs