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
- SrgsSubset.cs
- DesignTimeVisibleAttribute.cs
- PolygonHotSpot.cs
- DbConnectionInternal.cs
- WorkItem.cs
- ZoomingMessageFilter.cs
- LoadedOrUnloadedOperation.cs
- TextControlDesigner.cs
- WebPartHelpVerb.cs
- LongMinMaxAggregationOperator.cs
- Block.cs
- DateRangeEvent.cs
- CodeMethodInvokeExpression.cs
- LostFocusEventManager.cs
- OpenFileDialog.cs
- SplineKeyFrames.cs
- TextTreeExtractElementUndoUnit.cs
- TextEndOfLine.cs
- ControlCachePolicy.cs
- SqlVisitor.cs
- Transactions.cs
- ProviderUtil.cs
- DynamicResourceExtension.cs
- BindingRestrictions.cs
- CollectionViewGroupInternal.cs
- DocumentPageView.cs
- ResourceReader.cs
- SynchronizingStream.cs
- RectKeyFrameCollection.cs
- AbandonedMutexException.cs
- CatalogZone.cs
- IconEditor.cs
- RectAnimationUsingKeyFrames.cs
- ValidationSummary.cs
- ModelUIElement3D.cs
- CodeValidator.cs
- LabelLiteral.cs
- DynamicDiscoveryDocument.cs
- SpecularMaterial.cs
- BamlLocalizabilityResolver.cs
- sortedlist.cs
- MouseEvent.cs
- PopupControlService.cs
- QilGenerator.cs
- SafeRightsManagementPubHandle.cs
- PagePropertiesChangingEventArgs.cs
- HttpVersion.cs
- GradientBrush.cs
- XamlToRtfWriter.cs
- XmlSchemaComplexType.cs
- TemplateBindingExpression.cs
- CompiledRegexRunnerFactory.cs
- ApplicationProxyInternal.cs
- Receive.cs
- CqlLexerHelpers.cs
- CryptoHelper.cs
- Encoder.cs
- Annotation.cs
- ValidatorCollection.cs
- MsmqBindingElementBase.cs
- XsltContext.cs
- Semaphore.cs
- ACE.cs
- RegistrySecurity.cs
- HttpWebRequest.cs
- ContainerCodeDomSerializer.cs
- Grammar.cs
- SchemaElementLookUpTable.cs
- VisualStateGroup.cs
- DescendantBaseQuery.cs
- LinearGradientBrush.cs
- MultiDataTrigger.cs
- SecurityRuntime.cs
- autovalidator.cs
- Win32.cs
- DrawingBrush.cs
- AssemblyGen.cs
- RTLAwareMessageBox.cs
- Pair.cs
- AttachedPropertiesService.cs
- ToolStripGripRenderEventArgs.cs
- NetCodeGroup.cs
- StringValidatorAttribute.cs
- XPathAncestorIterator.cs
- EndpointAddressElementBase.cs
- RelationHandler.cs
- TreeNodeEventArgs.cs
- HandleCollector.cs
- RecordBuilder.cs
- RenderDataDrawingContext.cs
- RsaKeyIdentifierClause.cs
- SubstitutionResponseElement.cs
- EnumValAlphaComparer.cs
- RightsManagementEncryptionTransform.cs
- CookielessHelper.cs
- Query.cs
- WaitHandleCannotBeOpenedException.cs
- PreviewControlDesigner.cs
- XmlWellformedWriterHelpers.cs
- OpCodes.cs