Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
- InternalsVisibleToAttribute.cs
- PowerStatus.cs
- OpCodes.cs
- ExpressionLexer.cs
- FrameworkElement.cs
- TemplateBindingExtension.cs
- Vector3DCollectionValueSerializer.cs
- StringUtil.cs
- ImageCodecInfoPrivate.cs
- CalendarDateChangedEventArgs.cs
- TitleStyle.cs
- UserControl.cs
- DocumentSequenceHighlightLayer.cs
- UniqueIdentifierService.cs
- ScriptControlManager.cs
- XmlSchemaInfo.cs
- StartUpEventArgs.cs
- _CommandStream.cs
- DependsOnAttribute.cs
- TimeIntervalCollection.cs
- DebugView.cs
- DispatcherTimer.cs
- WindowsScrollBarBits.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- TimeSpanMinutesConverter.cs
- ImportContext.cs
- SafeNativeMethodsCLR.cs
- CodeDomConfigurationHandler.cs
- controlskin.cs
- OleDbSchemaGuid.cs
- PropVariant.cs
- EnumBuilder.cs
- NonVisualControlAttribute.cs
- PointCollection.cs
- BookmarkResumptionRecord.cs
- Math.cs
- FileDetails.cs
- BitmapVisualManager.cs
- UTF7Encoding.cs
- KeyedHashAlgorithm.cs
- AlignmentYValidation.cs
- ComponentSerializationService.cs
- ConnectionString.cs
- CharAnimationBase.cs
- WebServiceAttribute.cs
- AspNetCacheProfileAttribute.cs
- ProviderMetadataCachedInformation.cs
- EarlyBoundInfo.cs
- HostingPreferredMapPath.cs
- BindingNavigator.cs
- WithParamAction.cs
- SubclassTypeValidatorAttribute.cs
- GlyphTypeface.cs
- StreamInfo.cs
- CompareValidator.cs
- EditableRegion.cs
- XappLauncher.cs
- TextAdaptor.cs
- InvalidEnumArgumentException.cs
- BinaryObjectReader.cs
- TypeName.cs
- HostedTcpTransportManager.cs
- Query.cs
- ProviderUtil.cs
- DataTableMappingCollection.cs
- NonVisualControlAttribute.cs
- AnimationClockResource.cs
- SectionXmlInfo.cs
- ConfigurationManagerHelper.cs
- TakeOrSkipWhileQueryOperator.cs
- DynamicDiscoSearcher.cs
- ControllableStoryboardAction.cs
- XmlEventCache.cs
- ListDictionary.cs
- ToolStripItemEventArgs.cs
- StylusLogic.cs
- BitArray.cs
- ClientEventManager.cs
- EmptyCollection.cs
- ProvideValueServiceProvider.cs
- StylusEventArgs.cs
- SystemIPInterfaceProperties.cs
- QueryInterceptorAttribute.cs
- ServiceConfigurationTraceRecord.cs
- DataGridCaption.cs
- SQLInt64Storage.cs
- SectionVisual.cs
- RemoteWebConfigurationHostStream.cs
- COM2IDispatchConverter.cs
- RenamedEventArgs.cs
- DispatcherTimer.cs
- CryptoStream.cs
- DrawingGroup.cs
- CacheVirtualItemsEvent.cs
- TemplateComponentConnector.cs
- DbParameterHelper.cs
- ObjectHelper.cs
- X509UI.cs
- XmlDataSourceNodeDescriptor.cs
- ErrorFormatter.cs