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
- SelectionHighlightInfo.cs
- BinaryWriter.cs
- ContentElement.cs
- ScrollEvent.cs
- SqlCacheDependencyDatabase.cs
- PageCodeDomTreeGenerator.cs
- SoapConverter.cs
- IdleTimeoutMonitor.cs
- XsltException.cs
- CompositeControlDesigner.cs
- TreeViewItem.cs
- Serializer.cs
- MetadataCache.cs
- Regex.cs
- EncryptedKeyIdentifierClause.cs
- RefreshPropertiesAttribute.cs
- Int32RectConverter.cs
- ChannelDispatcherBase.cs
- KnownColorTable.cs
- Token.cs
- FileDialogCustomPlacesCollection.cs
- XmlConvert.cs
- CallTemplateAction.cs
- PropertyGridCommands.cs
- TemplatedMailWebEventProvider.cs
- SizeChangedEventArgs.cs
- DataFieldEditor.cs
- PrincipalPermission.cs
- EntityDataSourceConfigureObjectContext.cs
- TableRowCollection.cs
- ListItemCollection.cs
- LoadRetryStrategyFactory.cs
- ScaleTransform3D.cs
- NetTcpBindingElement.cs
- ServiceOperationWrapper.cs
- InputProcessorProfilesLoader.cs
- TextDocumentView.cs
- TogglePattern.cs
- FileUtil.cs
- RelationshipConstraintValidator.cs
- CompleteWizardStep.cs
- WCFBuildProvider.cs
- DataViewSettingCollection.cs
- DataTableMappingCollection.cs
- SerialErrors.cs
- DrawingContext.cs
- SmiEventStream.cs
- GridViewRow.cs
- EntityObject.cs
- SubtreeProcessor.cs
- SoapMessage.cs
- TaiwanLunisolarCalendar.cs
- HwndMouseInputProvider.cs
- ServiceContractListItemList.cs
- DataTemplateSelector.cs
- ApplicationException.cs
- CookieParameter.cs
- PointCollectionValueSerializer.cs
- SiteMapSection.cs
- XsltFunctions.cs
- Compiler.cs
- OletxVolatileEnlistment.cs
- EncryptedXml.cs
- Calendar.cs
- InteropTrackingRecord.cs
- RelationshipEntry.cs
- PageHandlerFactory.cs
- LongValidatorAttribute.cs
- UpdatePanelTriggerCollection.cs
- SymbolMethod.cs
- SQLUtility.cs
- NullableLongMinMaxAggregationOperator.cs
- UnknownWrapper.cs
- BoundField.cs
- CategoryNameCollection.cs
- RequestCachingSection.cs
- UnknownBitmapDecoder.cs
- BamlResourceContent.cs
- unsafenativemethodstextservices.cs
- TextSimpleMarkerProperties.cs
- RegexNode.cs
- LassoHelper.cs
- AtomServiceDocumentSerializer.cs
- CheckedPointers.cs
- ReadContentAsBinaryHelper.cs
- MimeMapping.cs
- RuleInfoComparer.cs
- BinHexDecoder.cs
- PropertyMetadata.cs
- ChildTable.cs
- XmlSchemaParticle.cs
- TableAutomationPeer.cs
- SymmetricAlgorithm.cs
- FormatterServices.cs
- AVElementHelper.cs
- Activation.cs
- TemplateComponentConnector.cs
- DesignerUtils.cs
- ButtonPopupAdapter.cs
- WebServiceParameterData.cs