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
- SqlBuffer.cs
- ProviderConnectionPointCollection.cs
- HebrewCalendar.cs
- DesignerUtils.cs
- ToolStripDropDownMenu.cs
- ThreadPool.cs
- ReferenceService.cs
- BitmapMetadataEnumerator.cs
- ActivityTypeCodeDomSerializer.cs
- ZipIOExtraFieldZip64Element.cs
- Native.cs
- ScriptComponentDescriptor.cs
- SymmetricSecurityBindingElement.cs
- regiisutil.cs
- BaseCollection.cs
- SBCSCodePageEncoding.cs
- DiscoveryDocumentReference.cs
- TabRenderer.cs
- PageSetupDialog.cs
- CodeTypeReferenceCollection.cs
- Events.cs
- DynamicMethod.cs
- GacUtil.cs
- ImmComposition.cs
- WorkflowFormatterBehavior.cs
- DataChangedEventManager.cs
- _CookieModule.cs
- VideoDrawing.cs
- BasePattern.cs
- TableStyle.cs
- SoapCommonClasses.cs
- SingleObjectCollection.cs
- XPathItem.cs
- ColorAnimationBase.cs
- OdbcRowUpdatingEvent.cs
- CubicEase.cs
- PeerCollaborationPermission.cs
- SubMenuStyleCollectionEditor.cs
- StreamAsIStream.cs
- ComEventsHelper.cs
- RequestQueryProcessor.cs
- SqlBuffer.cs
- IndicCharClassifier.cs
- DataGridViewImageColumn.cs
- DBSchemaTable.cs
- ByteFacetDescriptionElement.cs
- ExeConfigurationFileMap.cs
- QueueProcessor.cs
- _TimerThread.cs
- storepermission.cs
- oledbmetadatacolumnnames.cs
- GridItemCollection.cs
- DBSchemaTable.cs
- X509IssuerSerialKeyIdentifierClause.cs
- objectquery_tresulttype.cs
- DeclarationUpdate.cs
- BindingParameterCollection.cs
- XslAst.cs
- EventDescriptor.cs
- DataGridViewTextBoxEditingControl.cs
- ServiceOperationParameter.cs
- ParentControlDesigner.cs
- X509Chain.cs
- ByteStreamMessageEncoder.cs
- SystemColorTracker.cs
- UnauthorizedWebPart.cs
- Condition.cs
- UIElementParaClient.cs
- FontFamilyConverter.cs
- PopupRootAutomationPeer.cs
- LinqDataSourceView.cs
- CodeStatement.cs
- IUnknownConstantAttribute.cs
- AssemblyInfo.cs
- StickyNoteAnnotations.cs
- DoubleLinkList.cs
- ClassImporter.cs
- SurrogateSelector.cs
- AssemblyResolver.cs
- MetadataUtilsSmi.cs
- ImageIndexEditor.cs
- EnumUnknown.cs
- CancellationToken.cs
- OracleMonthSpan.cs
- EncryptedData.cs
- BaseAsyncResult.cs
- IsolatedStorageFile.cs
- NavigationPropertyAccessor.cs
- CallbackDebugBehavior.cs
- UmAlQuraCalendar.cs
- UrlMappingsModule.cs
- XslNumber.cs
- WebPartDescription.cs
- WindowManager.cs
- DataViewManager.cs
- unsafenativemethodstextservices.cs
- MarginCollapsingState.cs
- Compilation.cs
- CodeLinePragma.cs
- ServerIdentity.cs