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
- XPathConvert.cs
- Module.cs
- AsyncOperationContext.cs
- VisualStyleRenderer.cs
- RelationshipDetailsRow.cs
- PointAnimationUsingPath.cs
- RawStylusSystemGestureInputReport.cs
- SecurityTraceRecordHelper.cs
- PermissionSetTriple.cs
- SiteMapDataSourceView.cs
- ExceptionValidationRule.cs
- UserControl.cs
- ButtonField.cs
- SplashScreen.cs
- CapabilitiesAssignment.cs
- VectorCollectionValueSerializer.cs
- FontSourceCollection.cs
- BindingNavigatorDesigner.cs
- XmlWrappingReader.cs
- GB18030Encoding.cs
- OrderedDictionaryStateHelper.cs
- EntityDataReader.cs
- StrokeCollection2.cs
- StoreContentChangedEventArgs.cs
- CapabilitiesAssignment.cs
- HttpResponseHeader.cs
- SchemaImporterExtensionsSection.cs
- OleDbRowUpdatedEvent.cs
- ObjectTag.cs
- ListBoxItemAutomationPeer.cs
- Version.cs
- SqlAliasesReferenced.cs
- ReferencedCategoriesDocument.cs
- WorkflowInstanceContextProvider.cs
- BookmarkTable.cs
- ServiceOperation.cs
- RadioButton.cs
- ContractCodeDomInfo.cs
- WebPartVerb.cs
- ResourcesBuildProvider.cs
- TextRunTypographyProperties.cs
- TransformerInfo.cs
- CollectionViewGroupInternal.cs
- MessageQueue.cs
- Trustee.cs
- LambdaExpression.cs
- WindowsListView.cs
- milexports.cs
- CheckBox.cs
- PersonalizationAdministration.cs
- HttpStaticObjectsCollectionBase.cs
- XslNumber.cs
- SqlAliasesReferenced.cs
- NavigationHelper.cs
- MetaModel.cs
- TextModifier.cs
- PolicyStatement.cs
- BitmapDownload.cs
- TdsParserHelperClasses.cs
- XmlCharacterData.cs
- TaskFileService.cs
- TransactionException.cs
- EntitySqlQueryBuilder.cs
- WorkflowViewStateService.cs
- safemediahandle.cs
- DataGridColumnsPage.cs
- HtmlInputFile.cs
- ResolveNameEventArgs.cs
- XmlUrlResolver.cs
- DataGridClipboardCellContent.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CompositeCollectionView.cs
- RadioButtonAutomationPeer.cs
- ReferenceEqualityComparer.cs
- MetadataFile.cs
- TransactionScope.cs
- WebException.cs
- TrackingRecord.cs
- StyleTypedPropertyAttribute.cs
- ToolStripHighContrastRenderer.cs
- WeakKeyDictionary.cs
- SoapIncludeAttribute.cs
- TemplateBaseAction.cs
- CapacityStreamGeometryContext.cs
- TimeSpanOrInfiniteConverter.cs
- DataControlLinkButton.cs
- Thread.cs
- ButtonField.cs
- Root.cs
- SchemaCollectionPreprocessor.cs
- NamedPermissionSet.cs
- GridEntry.cs
- SmiEventStream.cs
- RequestTimeoutManager.cs
- HttpHandlersSection.cs
- DynamicILGenerator.cs
- ImageField.cs
- DecoderReplacementFallback.cs
- RuntimeCompatibilityAttribute.cs
- Membership.cs