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
- TrackingQueryElement.cs
- ViewStateException.cs
- Scanner.cs
- ClientTargetCollection.cs
- PriorityRange.cs
- CookieParameter.cs
- DBSchemaTable.cs
- WorkflowTerminatedException.cs
- XmlSchemaGroup.cs
- HtmlImageAdapter.cs
- XmlBufferReader.cs
- Pkcs9Attribute.cs
- PropertyValueUIItem.cs
- FontStretchConverter.cs
- Listbox.cs
- TransportationConfigurationTypeInstallComponent.cs
- EnvironmentPermission.cs
- SymLanguageVendor.cs
- Int32Animation.cs
- ModelFunctionTypeElement.cs
- XPathItem.cs
- PhysicalOps.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- AssemblyBuilder.cs
- CopyNodeSetAction.cs
- HebrewCalendar.cs
- CounterSample.cs
- SqlColumnizer.cs
- WebPartVerb.cs
- WebPartDeleteVerb.cs
- DefaultCommandConverter.cs
- ClientSession.cs
- UnsafeNativeMethods.cs
- UnmanagedMemoryStream.cs
- TabPage.cs
- QEncodedStream.cs
- ICspAsymmetricAlgorithm.cs
- XmlSchemaSimpleContentExtension.cs
- NameTable.cs
- PolicyChain.cs
- DesignerHierarchicalDataSourceView.cs
- pingexception.cs
- MenuBase.cs
- SourceItem.cs
- MethodImplAttribute.cs
- ComponentEditorPage.cs
- FileDataSourceCache.cs
- MonitoringDescriptionAttribute.cs
- ApplicationActivator.cs
- DataColumnPropertyDescriptor.cs
- X509CertificateTrustedIssuerElementCollection.cs
- FileReader.cs
- WebPartConnectionsConfigureVerb.cs
- ScrollViewerAutomationPeer.cs
- AnimationStorage.cs
- CompModSwitches.cs
- XPathAxisIterator.cs
- MailAddressParser.cs
- SchemaElementLookUpTable.cs
- TextEncodedRawTextWriter.cs
- ComponentSerializationService.cs
- BaseHashHelper.cs
- PropertyInfoSet.cs
- AppManager.cs
- DataSourceCacheDurationConverter.cs
- ProcessModule.cs
- IPEndPointCollection.cs
- WindowsIPAddress.cs
- StopStoryboard.cs
- DocComment.cs
- DataGridViewTopLeftHeaderCell.cs
- DataException.cs
- DesignTimeTemplateParser.cs
- MimeMapping.cs
- XsltContext.cs
- BStrWrapper.cs
- IPAddressCollection.cs
- DataGridViewCheckBoxCell.cs
- SynchronizationLockException.cs
- DynamicValidator.cs
- HostProtectionException.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- UriParserTemplates.cs
- rsa.cs
- ToolStripSystemRenderer.cs
- Quaternion.cs
- XmlCollation.cs
- WindowsTooltip.cs
- GZipObjectSerializer.cs
- CodeBlockBuilder.cs
- PeerApplication.cs
- LookupBindingPropertiesAttribute.cs
- NetStream.cs
- DataGridViewToolTip.cs
- ComboBoxRenderer.cs
- ByteConverter.cs
- ThumbButtonInfoCollection.cs
- PeerEndPoint.cs
- MetadataArtifactLoaderCompositeResource.cs
- DataGridViewComboBoxColumn.cs