Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / Xml / System / Xml / XPath / XPathNavigatorKeyComparer.cs / 1 / XPathNavigatorKeyComparer.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System.IO; using System.Xml.Schema; using System.Collections; using System.Diagnostics; using MS.Internal.Xml.Cache; namespace System.Xml.XPath { internal class XPathNavigatorKeyComparer : IEqualityComparer { bool IEqualityComparer.Equals( Object obj1, Object obj2 ) { XPathNavigator nav1 = obj1 as XPathNavigator; XPathNavigator nav2 = obj2 as XPathNavigator; if( ( nav1 != null ) && ( nav2 != null ) ) { if( nav1.IsSamePosition( nav2 ) ) return true; } return false; } int IEqualityComparer.GetHashCode ( Object obj ) { int hashCode; XPathNavigator nav; XPathDocumentNavigator xpdocNav; if (obj == null) { throw new ArgumentNullException("obj"); } else if ( null != (xpdocNav = obj as XPathDocumentNavigator) ) { hashCode = xpdocNav.GetPositionHashCode(); } else if( null != (nav = obj as XPathNavigator) ) { Object underlyingObject = nav.UnderlyingObject; if (underlyingObject != null) { hashCode = underlyingObject.GetHashCode(); } else { hashCode = (int)nav.NodeType; hashCode ^= nav.LocalName.GetHashCode(); hashCode ^= nav.Prefix.GetHashCode(); hashCode ^= nav.NamespaceURI.GetHashCode(); } } else { hashCode = obj.GetHashCode(); } return 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
- RangeBase.cs
- BypassElement.cs
- Cursor.cs
- QueryIntervalOp.cs
- EntityDataSourceDesigner.cs
- MailMessage.cs
- TransactionFlowElement.cs
- WizardStepBase.cs
- HashRepartitionEnumerator.cs
- MobileControlsSectionHandler.cs
- BitmapCodecInfoInternal.cs
- SecurityPermission.cs
- EditorZoneBase.cs
- Vector3dCollection.cs
- SapiRecoInterop.cs
- CompareValidator.cs
- Dump.cs
- DBProviderConfigurationHandler.cs
- WindowsContainer.cs
- JulianCalendar.cs
- EnumBuilder.cs
- PropertyTabAttribute.cs
- ProxyGenerationError.cs
- NavigationCommands.cs
- httpapplicationstate.cs
- HttpCacheVaryByContentEncodings.cs
- ClientRequest.cs
- DigitShape.cs
- ControlCachePolicy.cs
- BindingExpressionUncommonField.cs
- ChangeInterceptorAttribute.cs
- DataGridViewSelectedRowCollection.cs
- HtmlMobileTextWriter.cs
- SynchronizationScope.cs
- SortedDictionary.cs
- ReceiveContextCollection.cs
- BulletedList.cs
- DataTemplate.cs
- MenuItemStyleCollection.cs
- FrameworkElement.cs
- ChildDocumentBlock.cs
- EdmProviderManifest.cs
- DoubleLinkListEnumerator.cs
- DataGridViewCellPaintingEventArgs.cs
- SqlDataReaderSmi.cs
- SHA256CryptoServiceProvider.cs
- Visual3D.cs
- SqlCachedBuffer.cs
- SmtpSection.cs
- HtmlImage.cs
- Registry.cs
- DeferredElementTreeState.cs
- XmlDocument.cs
- Int32CollectionConverter.cs
- XXXInfos.cs
- EntityWrapper.cs
- DataGridViewCellParsingEventArgs.cs
- DockAndAnchorLayout.cs
- ListSortDescriptionCollection.cs
- DriveNotFoundException.cs
- DbBuffer.cs
- TemplateBamlRecordReader.cs
- TableRow.cs
- TableAdapterManagerNameHandler.cs
- BaseTemplateBuildProvider.cs
- DesignerActionItem.cs
- Page.cs
- XmlDictionaryReaderQuotas.cs
- AsnEncodedData.cs
- _NegotiateClient.cs
- BaseHashHelper.cs
- DispatchChannelSink.cs
- Window.cs
- DbProviderSpecificTypePropertyAttribute.cs
- InputChannel.cs
- InvalidWMPVersionException.cs
- KeyNotFoundException.cs
- DecoderFallbackWithFailureFlag.cs
- Latin1Encoding.cs
- CompositeCollectionView.cs
- TextViewElement.cs
- AuthenticationException.cs
- SafeFindHandle.cs
- ConfigurationPropertyCollection.cs
- Stroke2.cs
- MissingMemberException.cs
- XmlNavigatorStack.cs
- HatchBrush.cs
- TextDecorationCollection.cs
- ResizeGrip.cs
- ICollection.cs
- AuthenticateEventArgs.cs
- ReadOnlyPropertyMetadata.cs
- OrderByQueryOptionExpression.cs
- LinkedResourceCollection.cs
- StylusCaptureWithinProperty.cs
- FunctionUpdateCommand.cs
- ThemeDictionaryExtension.cs
- MessageQueueInstaller.cs
- Track.cs