Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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
- ErrorHandler.cs
- ToggleButton.cs
- MeasurementDCInfo.cs
- MobileSysDescriptionAttribute.cs
- TreeViewImageKeyConverter.cs
- DataKeyArray.cs
- ColumnCollection.cs
- documentation.cs
- FontInfo.cs
- XmlEventCache.cs
- SmtpReplyReader.cs
- DoubleCollection.cs
- UmAlQuraCalendar.cs
- MonitorWrapper.cs
- ProfileInfo.cs
- RelatedEnd.cs
- ExtendedPropertyCollection.cs
- Inflater.cs
- ListViewEditEventArgs.cs
- _UriTypeConverter.cs
- GenericIdentity.cs
- NavigationProgressEventArgs.cs
- Error.cs
- HandlerMappingMemo.cs
- DSASignatureDeformatter.cs
- SettingsPropertyValueCollection.cs
- Roles.cs
- AvTraceFormat.cs
- DataControlField.cs
- ChangeTracker.cs
- ScriptReference.cs
- ResourceProviderFactory.cs
- SqlBinder.cs
- ToolStripLabel.cs
- KernelTypeValidation.cs
- MetafileHeaderWmf.cs
- AnimationStorage.cs
- SqlConnectionString.cs
- Matrix3DConverter.cs
- SR.cs
- ReversePositionQuery.cs
- DirectoryRootQuery.cs
- SmtpDigestAuthenticationModule.cs
- COM2EnumConverter.cs
- NavigationHelper.cs
- WebPartTransformer.cs
- Image.cs
- returneventsaver.cs
- UIElementAutomationPeer.cs
- DataSourceHelper.cs
- SqlReferenceCollection.cs
- CodeDomConfigurationHandler.cs
- Form.cs
- DBDataPermissionAttribute.cs
- TileBrush.cs
- NotCondition.cs
- CaseCqlBlock.cs
- CompositeCollection.cs
- Axis.cs
- EventLogPermissionAttribute.cs
- StopStoryboard.cs
- BoundField.cs
- ButtonFlatAdapter.cs
- PackWebResponse.cs
- TabItemWrapperAutomationPeer.cs
- TdsParserSafeHandles.cs
- CodeCatchClause.cs
- TiffBitmapEncoder.cs
- Int16KeyFrameCollection.cs
- BindValidationContext.cs
- ListBase.cs
- MessageQueueEnumerator.cs
- PartialToken.cs
- TdsEnums.cs
- JpegBitmapDecoder.cs
- TemplatedWizardStep.cs
- MultiView.cs
- ToolboxItemAttribute.cs
- TempFiles.cs
- HtmlTernaryTree.cs
- BufferModesCollection.cs
- NotifyParentPropertyAttribute.cs
- AmbiguousMatchException.cs
- BufferedMessageWriter.cs
- BasicCellRelation.cs
- Type.cs
- IssuanceLicense.cs
- PersonalizationDictionary.cs
- GridViewColumnCollectionChangedEventArgs.cs
- FileIOPermission.cs
- RegionData.cs
- SemaphoreSecurity.cs
- COM2IProvidePropertyBuilderHandler.cs
- CurrentTimeZone.cs
- ResetableIterator.cs
- TagPrefixCollection.cs
- XhtmlBasicValidatorAdapter.cs
- DefaultProxySection.cs
- InkCanvasSelectionAdorner.cs
- DSACryptoServiceProvider.cs