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
- WindowsProgressbar.cs
- SwitchElementsCollection.cs
- SessionStateSection.cs
- BCryptSafeHandles.cs
- TreeNodeClickEventArgs.cs
- FileUpload.cs
- ErrorWebPart.cs
- InheritanceAttribute.cs
- HwndSourceKeyboardInputSite.cs
- ObjectDataSourceEventArgs.cs
- DeclaredTypeElementCollection.cs
- LoginCancelEventArgs.cs
- DocumentViewerHelper.cs
- TimeSpanSecondsConverter.cs
- Verify.cs
- CapabilitiesRule.cs
- VolatileResourceManager.cs
- Int16KeyFrameCollection.cs
- DocumentsTrace.cs
- Dynamic.cs
- BindingGroup.cs
- Mapping.cs
- BitmapEffectDrawing.cs
- DependencyObjectProvider.cs
- LookupBindingPropertiesAttribute.cs
- FtpRequestCacheValidator.cs
- FontSource.cs
- UserMapPath.cs
- Size.cs
- ImageAttributes.cs
- cache.cs
- DataRecordObjectView.cs
- KeyboardEventArgs.cs
- GcSettings.cs
- SafeThreadHandle.cs
- DispatchChannelSink.cs
- RegistryKey.cs
- ExponentialEase.cs
- ErrorWebPart.cs
- LambdaSerializationException.cs
- TextElement.cs
- safemediahandle.cs
- Label.cs
- XamlToRtfParser.cs
- ListenerAdapterBase.cs
- __ConsoleStream.cs
- HttpModuleAction.cs
- DbgUtil.cs
- DiscoveryClientBindingElement.cs
- BadImageFormatException.cs
- HtmlCalendarAdapter.cs
- HttpHandler.cs
- CodePageUtils.cs
- GrammarBuilderWildcard.cs
- _UncName.cs
- ElementUtil.cs
- StringPropertyBuilder.cs
- CodeTypeReferenceExpression.cs
- DisplayClaim.cs
- Section.cs
- OwnerDrawPropertyBag.cs
- DiagnosticSection.cs
- shaperfactory.cs
- FactoryId.cs
- BasicHttpSecurityMode.cs
- OlePropertyStructs.cs
- GridLengthConverter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- FixedSOMImage.cs
- XmlSchemaType.cs
- AvtEvent.cs
- LinqTreeNodeEvaluator.cs
- ControlIdConverter.cs
- Facet.cs
- EntityStoreSchemaFilterEntry.cs
- RightsManagementInformation.cs
- ConstraintStruct.cs
- IndependentAnimationStorage.cs
- ContainerControl.cs
- DataGridItem.cs
- ToolStripContentPanel.cs
- EvidenceTypeDescriptor.cs
- HijriCalendar.cs
- XmlSchemaComplexContent.cs
- HttpWebResponse.cs
- RemotingConfigParser.cs
- SwitchLevelAttribute.cs
- HttpInputStream.cs
- FontFamily.cs
- ButtonRenderer.cs
- ValueQuery.cs
- RectAnimationClockResource.cs
- StrokeSerializer.cs
- InputLanguageProfileNotifySink.cs
- ThreadExceptionEvent.cs
- FormViewUpdatedEventArgs.cs
- AutoGeneratedField.cs
- XmlILAnnotation.cs
- AdornerPresentationContext.cs
- UnmanagedMemoryStreamWrapper.cs