Code:
/ DotNET / DotNET / 8.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
- OpCopier.cs
- RuntimeEnvironment.cs
- MsmqHostedTransportManager.cs
- KeyedByTypeCollection.cs
- RSAOAEPKeyExchangeDeformatter.cs
- AutomationIdentifier.cs
- DataGridViewRowsRemovedEventArgs.cs
- Stylus.cs
- ContentFileHelper.cs
- ForAllOperator.cs
- ProxyWebPartConnectionCollection.cs
- HttpCacheParams.cs
- Pen.cs
- WebControl.cs
- DataTableMapping.cs
- XmlSchemaAppInfo.cs
- ShaderEffect.cs
- BamlLocalizer.cs
- DataGridSortCommandEventArgs.cs
- NameScopePropertyAttribute.cs
- AttributeProviderAttribute.cs
- User.cs
- UIElementParaClient.cs
- ListViewHitTestInfo.cs
- CodeMethodInvokeExpression.cs
- ResXFileRef.cs
- OrderedDictionary.cs
- QuaternionKeyFrameCollection.cs
- SafeNativeMethods.cs
- RepeatBehavior.cs
- ParameterDataSourceExpression.cs
- DynamicArgumentDialog.cs
- CellParagraph.cs
- Win32PrintDialog.cs
- NullReferenceException.cs
- MatrixTransform.cs
- SendActivityDesigner.cs
- CapabilitiesUse.cs
- RegistryKey.cs
- Pointer.cs
- WindowsRebar.cs
- State.cs
- __Filters.cs
- SystemSounds.cs
- ObservableCollection.cs
- Context.cs
- HandlerBase.cs
- UserInitiatedNavigationPermission.cs
- shaper.cs
- ResourceWriter.cs
- XamlTemplateSerializer.cs
- SqlGenerator.cs
- DataGridTextColumn.cs
- FocusWithinProperty.cs
- PairComparer.cs
- IdleTimeoutMonitor.cs
- SapiGrammar.cs
- _BasicClient.cs
- ListenerElementsCollection.cs
- UInt32Converter.cs
- FreezableDefaultValueFactory.cs
- DurationConverter.cs
- TraceEventCache.cs
- MetadataArtifactLoaderFile.cs
- RemotingSurrogateSelector.cs
- OleDbErrorCollection.cs
- ImageInfo.cs
- StyleSheet.cs
- GridViewItemAutomationPeer.cs
- DataGridViewButtonColumn.cs
- Lasso.cs
- EventLogPermissionAttribute.cs
- CompositeDataBoundControl.cs
- MorphHelper.cs
- IPPacketInformation.cs
- CfgArc.cs
- SortDescription.cs
- TypedTableBaseExtensions.cs
- Vector3D.cs
- ValidationEventArgs.cs
- OdbcConnectionOpen.cs
- TextEncodedRawTextWriter.cs
- SecurityAccessDeniedException.cs
- EntityDataSourceWizardForm.cs
- SqlNodeTypeOperators.cs
- ViewLoader.cs
- MethodToken.cs
- FormatException.cs
- BindingBase.cs
- ListItemCollection.cs
- XmlSerializerAssemblyAttribute.cs
- RootCodeDomSerializer.cs
- Oid.cs
- TextEditorSelection.cs
- ConnectionManagementElement.cs
- SafeLocalAllocation.cs
- PictureBox.cs
- CustomError.cs
- UIElement3D.cs
- TextWriter.cs