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
- TextTreeFixupNode.cs
- RectKeyFrameCollection.cs
- PlainXmlSerializer.cs
- CustomTokenProvider.cs
- ToolBar.cs
- TreeWalkHelper.cs
- SecurityMode.cs
- WindowsToolbar.cs
- AccessorTable.cs
- CompiledWorkflowDefinitionContext.cs
- EncoderNLS.cs
- HashMembershipCondition.cs
- WsdlBuildProvider.cs
- XmlToDatasetMap.cs
- XmlConvert.cs
- __Filters.cs
- ISAPIRuntime.cs
- EmptyCollection.cs
- NeutralResourcesLanguageAttribute.cs
- ArraySet.cs
- WebPartEditorCancelVerb.cs
- FloaterBaseParagraph.cs
- ProcessProtocolHandler.cs
- XPathNodeHelper.cs
- StringArrayConverter.cs
- TypeLibraryHelper.cs
- Underline.cs
- Privilege.cs
- RecommendedAsConfigurableAttribute.cs
- WmpBitmapEncoder.cs
- Schema.cs
- StorageAssociationTypeMapping.cs
- DataListCommandEventArgs.cs
- SimplePropertyEntry.cs
- GiveFeedbackEvent.cs
- DesignerFrame.cs
- NavigationEventArgs.cs
- GPRECTF.cs
- ParsedRoute.cs
- StrongNameIdentityPermission.cs
- CaseCqlBlock.cs
- CodeArgumentReferenceExpression.cs
- SQLDateTimeStorage.cs
- DtdParser.cs
- Canonicalizers.cs
- CmsInterop.cs
- EntityViewGenerator.cs
- FormsAuthenticationEventArgs.cs
- HorizontalAlignConverter.cs
- SqlAggregateChecker.cs
- NativeActivity.cs
- TypedColumnHandler.cs
- PropertyCollection.cs
- FileDataSourceCache.cs
- EditorBrowsableAttribute.cs
- IListConverters.cs
- SecurityImpersonationBehavior.cs
- ActionItem.cs
- remotingproxy.cs
- ClosableStream.cs
- TreeNodeCollection.cs
- RightsManagementInformation.cs
- Function.cs
- CapabilitiesPattern.cs
- VectorValueSerializer.cs
- HtmlEmptyTagControlBuilder.cs
- UITypeEditor.cs
- OraclePermissionAttribute.cs
- InputReport.cs
- StrokeCollection.cs
- PasswordTextContainer.cs
- ClientSettings.cs
- XmlBinaryReader.cs
- IntPtr.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
- ParameterToken.cs
- CodeLinePragma.cs
- pingexception.cs
- FileDialog_Vista.cs
- SqlDataSourceCommandEventArgs.cs
- DynamicUpdateCommand.cs
- NumberFormatInfo.cs
- CodeDomSerializer.cs
- MaskDescriptor.cs
- SiteMapSection.cs
- InputScope.cs
- SystemShuttingDownException.cs
- GroupItemAutomationPeer.cs
- FileDetails.cs
- SqlProfileProvider.cs
- GACMembershipCondition.cs
- ProfileService.cs
- RichTextBoxAutomationPeer.cs
- InstanceStoreQueryResult.cs
- DataRowView.cs
- IgnoreFileBuildProvider.cs
- TextParagraphView.cs
- CodeCommentStatementCollection.cs
- DataSourceHelper.cs
- XmlBinaryReader.cs