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
- DataChangedEventManager.cs
- HttpHandlerAction.cs
- FrameworkObject.cs
- NullableFloatMinMaxAggregationOperator.cs
- TemplateLookupAction.cs
- diagnosticsswitches.cs
- FixedTextView.cs
- TdsParserSafeHandles.cs
- ValuePatternIdentifiers.cs
- ResponseStream.cs
- XmlSerializationGeneratedCode.cs
- WebDescriptionAttribute.cs
- MarkupCompilePass1.cs
- SByteConverter.cs
- TriggerBase.cs
- ReferencedAssembly.cs
- Rect.cs
- EnumCodeDomSerializer.cs
- BinarySerializer.cs
- SHA512Managed.cs
- XmlNullResolver.cs
- SQLByte.cs
- SqlConnection.cs
- Int16AnimationBase.cs
- InputLanguageEventArgs.cs
- ArithmeticException.cs
- Nullable.cs
- ListBoxItem.cs
- sapiproxy.cs
- MenuItemStyleCollection.cs
- LinqToSqlWrapper.cs
- InheritanceAttribute.cs
- XmlSchemaExternal.cs
- ClientRoleProvider.cs
- X509KeyIdentifierClauseType.cs
- TypeLoadException.cs
- CounterSample.cs
- ColorTransform.cs
- UnsafeNativeMethods.cs
- ScrollableControl.cs
- Quaternion.cs
- DataGridViewAutoSizeModeEventArgs.cs
- FixedSOMTableCell.cs
- XmlSerializationReader.cs
- FileCodeGroup.cs
- TransformedBitmap.cs
- PropertyExpression.cs
- MachineKeyValidationConverter.cs
- HyperlinkAutomationPeer.cs
- PackageRelationshipSelector.cs
- SignatureToken.cs
- SecurityUtils.cs
- KeyInfo.cs
- ContextStack.cs
- ProfileProvider.cs
- HiddenFieldPageStatePersister.cs
- CheckBox.cs
- MultipleCopiesCollection.cs
- Rotation3D.cs
- FillErrorEventArgs.cs
- Transform.cs
- Geometry3D.cs
- DataSourceSelectArguments.cs
- ExtentKey.cs
- ExceptionHelpers.cs
- VerificationAttribute.cs
- ViewgenContext.cs
- ObjectNavigationPropertyMapping.cs
- DescendentsWalkerBase.cs
- VariableAction.cs
- TextServicesDisplayAttribute.cs
- WindowsAuthenticationEventArgs.cs
- ClientRequest.cs
- LocalizableAttribute.cs
- TraceUtils.cs
- NumberFormatter.cs
- ErasingStroke.cs
- WebBrowserHelper.cs
- Pen.cs
- InternalControlCollection.cs
- Light.cs
- ToolStripDesignerUtils.cs
- MostlySingletonList.cs
- xsdvalidator.cs
- MouseGestureValueSerializer.cs
- PartDesigner.cs
- wpf-etw.cs
- DesignParameter.cs
- DataObjectCopyingEventArgs.cs
- BamlLocalizer.cs
- DeviceContexts.cs
- ControlPaint.cs
- CreateUserErrorEventArgs.cs
- TypeToken.cs
- DbConnectionPoolGroupProviderInfo.cs
- TileBrush.cs
- ExchangeUtilities.cs
- ProfilePropertyNameValidator.cs
- ConstraintCollection.cs
- ResXBuildProvider.cs