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
- SettingsSection.cs
- DatatypeImplementation.cs
- TdsParserSafeHandles.cs
- DiagnosticEventProvider.cs
- COM2Properties.cs
- ViewCellSlot.cs
- FontFamily.cs
- TabItem.cs
- IntSecurity.cs
- NonceToken.cs
- ContentFilePart.cs
- HttpCookie.cs
- SmiEventSink.cs
- ParameterModifier.cs
- DrawingContext.cs
- MultipleViewProviderWrapper.cs
- UserControlParser.cs
- EventlogProvider.cs
- ImageConverter.cs
- infer.cs
- InfoCardRSACryptoProvider.cs
- PageThemeCodeDomTreeGenerator.cs
- ThrowOnMultipleAssignment.cs
- WsatConfiguration.cs
- SaveFileDialog.cs
- DbMetaDataColumnNames.cs
- SignedPkcs7.cs
- BooleanAnimationBase.cs
- ConfigurationSectionHelper.cs
- DynamicExpression.cs
- UnlockCardRequest.cs
- PermissionSetEnumerator.cs
- ThreadStartException.cs
- Funcletizer.cs
- SqlNode.cs
- NameTable.cs
- uribuilder.cs
- ModelPropertyCollectionImpl.cs
- Pen.cs
- BounceEase.cs
- HotSpot.cs
- _NTAuthentication.cs
- DataGridViewSelectedColumnCollection.cs
- DisplayNameAttribute.cs
- SafeSecurityHelper.cs
- FigureParagraph.cs
- MailDefinitionBodyFileNameEditor.cs
- ListBindingHelper.cs
- TrackingServices.cs
- ProvideValueServiceProvider.cs
- InvalidProgramException.cs
- CacheSection.cs
- ValidationEventArgs.cs
- SpAudioStreamWrapper.cs
- QueryCacheKey.cs
- BlockUIContainer.cs
- RemoteWebConfigurationHostServer.cs
- DocumentPageHost.cs
- HtmlDocument.cs
- Error.cs
- Random.cs
- XmlSequenceWriter.cs
- AppDomainManager.cs
- CollectionViewGroupRoot.cs
- SecurityElement.cs
- ScriptServiceAttribute.cs
- ServiceModelActivationSectionGroup.cs
- QuestionEventArgs.cs
- MdiWindowListStrip.cs
- ObjectSet.cs
- RawAppCommandInputReport.cs
- WinFormsUtils.cs
- _ScatterGatherBuffers.cs
- StateMachineWorkflowDesigner.cs
- AssemblyInfo.cs
- Parameter.cs
- ReliableDuplexSessionChannel.cs
- ReturnType.cs
- SessionKeyExpiredException.cs
- DataGridClipboardCellContent.cs
- TreeBuilderXamlTranslator.cs
- InternalControlCollection.cs
- Point4DConverter.cs
- Vector3DConverter.cs
- EncryptedReference.cs
- NeutralResourcesLanguageAttribute.cs
- WebFormsRootDesigner.cs
- ColorIndependentAnimationStorage.cs
- DictionaryManager.cs
- DbConnectionPoolGroupProviderInfo.cs
- WindowsBrush.cs
- SystemIPv6InterfaceProperties.cs
- DiffuseMaterial.cs
- latinshape.cs
- ToolStripAdornerWindowService.cs
- OleDbRowUpdatingEvent.cs
- OutputCacheModule.cs
- InvalidComObjectException.cs
- AutomationInteropProvider.cs
- ColorInterpolationModeValidation.cs