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
- ProxyWebPartConnectionCollection.cs
- ApplicationContext.cs
- future.cs
- TouchFrameEventArgs.cs
- ObjectKeyFrameCollection.cs
- PathData.cs
- TraceData.cs
- SiteMapDataSource.cs
- WindowsRegion.cs
- AssemblyUtil.cs
- DataGridHeaderBorder.cs
- XmlUtil.cs
- DeferredElementTreeState.cs
- SourceFileBuildProvider.cs
- SafeTokenHandle.cs
- StylusPointDescription.cs
- TextBounds.cs
- SearchExpression.cs
- RuntimeEnvironment.cs
- BindStream.cs
- TemplateAction.cs
- WebSysDefaultValueAttribute.cs
- PeerName.cs
- DataViewManager.cs
- future.cs
- Char.cs
- DbBuffer.cs
- RowType.cs
- PeerNameRegistration.cs
- MasterPage.cs
- QueryOpcode.cs
- Win32MouseDevice.cs
- String.cs
- ShapingEngine.cs
- BaseParser.cs
- DataGridViewTopLeftHeaderCell.cs
- SymmetricKey.cs
- diagnosticsswitches.cs
- SimpleApplicationHost.cs
- RolePrincipal.cs
- HostSecurityManager.cs
- SimpleMailWebEventProvider.cs
- DynamicMethod.cs
- NamespaceDisplayAutomationPeer.cs
- InvalidAsynchronousStateException.cs
- TemplateAction.cs
- GetWinFXPath.cs
- SamlSecurityToken.cs
- MethodCallExpression.cs
- BasePropertyDescriptor.cs
- XmlSchemaAppInfo.cs
- BypassElement.cs
- Span.cs
- EntityObject.cs
- MetabaseServerConfig.cs
- TPLETWProvider.cs
- ServiceOperationInvoker.cs
- CharacterMetrics.cs
- HandleCollector.cs
- HyperlinkAutomationPeer.cs
- XmlResolver.cs
- FileSecurity.cs
- EntityDataSourceView.cs
- LayoutSettings.cs
- GenerateHelper.cs
- Lease.cs
- CreateUserWizardStep.cs
- EventBuilder.cs
- DataListItemCollection.cs
- BinaryConverter.cs
- KnownBoxes.cs
- XmlBufferReader.cs
- FunctionNode.cs
- Validator.cs
- PartialCachingControl.cs
- OutputCacheModule.cs
- UIPermission.cs
- Material.cs
- ObjectQueryState.cs
- NullableDoubleSumAggregationOperator.cs
- SafeRightsManagementHandle.cs
- SmiEventSink.cs
- VisualTransition.cs
- TextCompositionManager.cs
- MatrixAnimationUsingKeyFrames.cs
- InkCanvasFeedbackAdorner.cs
- RawTextInputReport.cs
- InputScopeManager.cs
- VisualStyleElement.cs
- OdbcConnectionPoolProviderInfo.cs
- DataGridTextBox.cs
- ParserExtension.cs
- ApplicationFileParser.cs
- ExtenderProvidedPropertyAttribute.cs
- TextServicesPropertyRanges.cs
- WebPartMenu.cs
- AssemblySettingAttributes.cs
- OdbcEnvironment.cs
- ConfigXmlElement.cs
- TextEditorSelection.cs