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
- HttpResponseInternalWrapper.cs
- PKCS1MaskGenerationMethod.cs
- FrameworkPropertyMetadata.cs
- Token.cs
- DataAdapter.cs
- BitmapEffectInputConnector.cs
- AnchorEditor.cs
- RtfControls.cs
- _HeaderInfo.cs
- StylusEditingBehavior.cs
- ControlUtil.cs
- RelationalExpressions.cs
- WebBrowserBase.cs
- SimpleRecyclingCache.cs
- EventLogPermissionEntryCollection.cs
- HttpModuleActionCollection.cs
- GPRECTF.cs
- CommandEventArgs.cs
- Resources.Designer.cs
- Slider.cs
- DataServiceRequest.cs
- CodeGroup.cs
- TextChangedEventArgs.cs
- StringFreezingAttribute.cs
- CursorInteropHelper.cs
- PresentationTraceSources.cs
- WebInvokeAttribute.cs
- FileUpload.cs
- FileRecordSequence.cs
- NetworkCredential.cs
- XmlFileEditor.cs
- DrawingState.cs
- SettingsPropertyValue.cs
- XmlNavigatorFilter.cs
- FieldReference.cs
- OdbcTransaction.cs
- SimpleWorkerRequest.cs
- ProcessModuleCollection.cs
- PerformanceCounterPermissionEntry.cs
- XmlText.cs
- LinearGradientBrush.cs
- InvalidCastException.cs
- WmpBitmapDecoder.cs
- SemanticResolver.cs
- InvalidProgramException.cs
- FaultReason.cs
- ApplicationSecurityManager.cs
- ScrollBar.cs
- WebServiceTypeData.cs
- Codec.cs
- SpeechAudioFormatInfo.cs
- RubberbandSelector.cs
- GrammarBuilderRuleRef.cs
- DesignerLoader.cs
- ChangeConflicts.cs
- HttpCachePolicy.cs
- SafeViewOfFileHandle.cs
- HttpClientChannel.cs
- BitmapEffectDrawing.cs
- TreeView.cs
- DesigntimeLicenseContextSerializer.cs
- MimePart.cs
- DataGridViewControlCollection.cs
- DbParameterCollectionHelper.cs
- Environment.cs
- FormatterServicesNoSerializableCheck.cs
- ImageMetadata.cs
- CompilerWrapper.cs
- StringAttributeCollection.cs
- DirectoryObjectSecurity.cs
- TiffBitmapEncoder.cs
- DragEvent.cs
- ThreadSafeMessageFilterTable.cs
- BooleanAnimationUsingKeyFrames.cs
- mediapermission.cs
- StaticResourceExtension.cs
- ProxyWebPartConnectionCollection.cs
- Vector.cs
- MenuScrollingVisibilityConverter.cs
- TextElement.cs
- GenerateTemporaryTargetAssembly.cs
- SessionStateUtil.cs
- InvariantComparer.cs
- SizeF.cs
- MailAddress.cs
- ToolboxService.cs
- HashCodeCombiner.cs
- GenericTypeParameterBuilder.cs
- Binding.cs
- CriticalHandle.cs
- _DigestClient.cs
- FillErrorEventArgs.cs
- PackageDigitalSignatureManager.cs
- Validator.cs
- COM2IDispatchConverter.cs
- TraceLog.cs
- DataGridViewDesigner.cs
- GlobalAclOperationRequirement.cs
- UIHelper.cs
- DataRow.cs