Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Xml / System / Xml / XPath / XPathNavigatorKeyComparer.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SemanticResolver.cs
- COSERVERINFO.cs
- ViewGenResults.cs
- DisplayInformation.cs
- CodeExpressionStatement.cs
- SchemaAttDef.cs
- WSHttpBinding.cs
- LookupNode.cs
- ViewCellSlot.cs
- IRCollection.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- PersistenceParticipant.cs
- StorageEndPropertyMapping.cs
- ContextDataSource.cs
- ResXBuildProvider.cs
- ViewGenerator.cs
- HiddenField.cs
- wgx_exports.cs
- RegisteredHiddenField.cs
- NativeWindow.cs
- BindingExpressionUncommonField.cs
- SqlDataSourceQueryEditor.cs
- SelectionEditor.cs
- ValidatorCompatibilityHelper.cs
- Transform.cs
- TextDecorationCollection.cs
- SolidBrush.cs
- PlainXmlSerializer.cs
- TypeDescriptionProviderAttribute.cs
- LogSwitch.cs
- EntitySetDataBindingList.cs
- XmlReflectionMember.cs
- Attributes.cs
- XPathDescendantIterator.cs
- DuplicateWaitObjectException.cs
- _CommandStream.cs
- PrintPageEvent.cs
- GatewayDefinition.cs
- DataGridViewRowEventArgs.cs
- PropertyPathWorker.cs
- ErasingStroke.cs
- NumericUpDown.cs
- AttachedAnnotationChangedEventArgs.cs
- Base64Decoder.cs
- SemanticBasicElement.cs
- Parser.cs
- BamlResourceDeserializer.cs
- DecoratedNameAttribute.cs
- NullableLongAverageAggregationOperator.cs
- Automation.cs
- ComponentFactoryHelpers.cs
- IntSecurity.cs
- Int32.cs
- DataGridViewLinkColumn.cs
- CompiledQueryCacheKey.cs
- DataGridViewCellParsingEventArgs.cs
- Token.cs
- SourceSwitch.cs
- BaseTreeIterator.cs
- UnsafeNativeMethods.cs
- TextElementAutomationPeer.cs
- TemplateKey.cs
- WebPartDisplayModeCancelEventArgs.cs
- _SingleItemRequestCache.cs
- IEnumerable.cs
- CodeBlockBuilder.cs
- ErrorActivity.cs
- SqlConnectionStringBuilder.cs
- ByteStorage.cs
- CompilerWrapper.cs
- DateTimeOffsetConverter.cs
- AnimatedTypeHelpers.cs
- FormsIdentity.cs
- XmlAttribute.cs
- Exceptions.cs
- ControlIdConverter.cs
- SmtpNetworkElement.cs
- ObjectQueryState.cs
- XmlSchemaNotation.cs
- DockProviderWrapper.cs
- DataControlLinkButton.cs
- CallSite.cs
- WebPartDisplayModeEventArgs.cs
- ProxyWebPartConnectionCollection.cs
- WebPartConnection.cs
- DoubleLink.cs
- CompilerHelpers.cs
- EventEntry.cs
- ProfileInfo.cs
- SafeNativeMemoryHandle.cs
- ExpandableObjectConverter.cs
- MasterPageBuildProvider.cs
- XmlStrings.cs
- SqlRemoveConstantOrderBy.cs
- ButtonBaseAdapter.cs
- DataGridViewControlCollection.cs
- XmlName.cs
- SqlXmlStorage.cs
- Separator.cs
- AudioFormatConverter.cs