Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MouseCaptureWithinProperty.cs
- ParameterExpression.cs
- UrlPropertyAttribute.cs
- ContainerSelectorBehavior.cs
- sqlnorm.cs
- Delegate.cs
- MulticastOption.cs
- SchemaCollectionPreprocessor.cs
- RangeBase.cs
- BasicCellRelation.cs
- CustomPopupPlacement.cs
- BindingExpressionBase.cs
- VerticalAlignConverter.cs
- BaseCollection.cs
- ToolStripDropDownItemDesigner.cs
- RegexRunner.cs
- TemplateEditingService.cs
- TreeViewDesigner.cs
- TextTreeUndoUnit.cs
- CollectionViewGroupInternal.cs
- FontDifferentiator.cs
- WorkflowEventArgs.cs
- CursorConverter.cs
- HostUtils.cs
- BindingManagerDataErrorEventArgs.cs
- ProtocolsConfiguration.cs
- XmlRawWriter.cs
- UIntPtr.cs
- RegularExpressionValidator.cs
- InlinedAggregationOperatorEnumerator.cs
- Point3DAnimation.cs
- DataGridHelper.cs
- MenuItem.cs
- OdbcUtils.cs
- InertiaTranslationBehavior.cs
- UTF32Encoding.cs
- HtmlTableRowCollection.cs
- ProcessHost.cs
- Point3DCollectionValueSerializer.cs
- CharacterMetrics.cs
- MutexSecurity.cs
- Regex.cs
- SettingsPropertyIsReadOnlyException.cs
- RightsManagementInformation.cs
- SpeechEvent.cs
- BasicDesignerLoader.cs
- MimeTypeAttribute.cs
- TextParaLineResult.cs
- TableParaClient.cs
- Types.cs
- AuthStoreRoleProvider.cs
- CompilationSection.cs
- NonSerializedAttribute.cs
- GeometryCollection.cs
- EventLogPermission.cs
- ConfigXmlDocument.cs
- WindowsFormsSynchronizationContext.cs
- IChannel.cs
- HttpProfileBase.cs
- PeerInvitationResponse.cs
- bidPrivateBase.cs
- FontCacheUtil.cs
- ColumnMap.cs
- LiteralTextContainerControlBuilder.cs
- PropertyChangeTracker.cs
- PtsContext.cs
- EntityViewGenerator.cs
- CompilerGeneratedAttribute.cs
- ExeConfigurationFileMap.cs
- Animatable.cs
- TraversalRequest.cs
- TreeView.cs
- Lease.cs
- XsltLoader.cs
- Application.cs
- CharKeyFrameCollection.cs
- WebPartVerbsEventArgs.cs
- Exceptions.cs
- ElementHostAutomationPeer.cs
- ControlUtil.cs
- WindowsFormsHostPropertyMap.cs
- CorePropertiesFilter.cs
- SqlDataRecord.cs
- ResourceContainer.cs
- DialogWindow.cs
- XPathExpr.cs
- HandledEventArgs.cs
- Switch.cs
- XPathMultyIterator.cs
- HttpResponseHeader.cs
- WindowExtensionMethods.cs
- UnmanagedMemoryStreamWrapper.cs
- WebPartUtil.cs
- FormViewPageEventArgs.cs
- ZipPackagePart.cs
- MILUtilities.cs
- BackgroundFormatInfo.cs
- XsltLoader.cs
- OletxDependentTransaction.cs
- SqlFunctionAttribute.cs