本文整理汇总了C#中System.Xml.XPath.XPathNavigator.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.GetHashCode方法的具体用法?C# XPathNavigator.GetHashCode怎么用?C# XPathNavigator.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.GetHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSamePosition
/// <summary>
/// See <see cref="System.Xml.XPath.XPathNavigator.IsSamePosition" /> for details.
/// </summary>
/// <returns>Returns <see langword="true"/> if this navigator is positioned
/// at the same node as other navigator, and <see langword="false"/>
/// otherwise.</returns>
public override bool IsSamePosition( XPathNavigator other )
{
#if DEBUG
Trace( () => string.Format( "IsSamePosition( N#{0} )", other.GetHashCode() ) );
#endif
var x = other as ObjectXPathNavigator;
if( x == null )
return false;
if( _context != x._context )
return false;
// Compare child navigators
if( _childNav != null )
return x._childNav != null && _childNav.IsSamePosition( x._childNav );
if( x._childNav != null )
// In case if our navigator is null and other is not.
return false;
return _node == x._node;
}
示例2: MoveTo
/// <summary>
/// See <see cref="System.Xml.XPath.XPathNavigator.MoveTo" /> for details.
/// </summary>
public override bool MoveTo( XPathNavigator other )
{
var otherNav = other as ObjectXPathNavigator;
if( otherNav == null )
return false;
_context = otherNav._context;
_root = otherNav._root;
_node = otherNav._node;
if( otherNav._childNav != null )
{
_childNav = otherNav._childNav.Clone();
_childNavDepth = otherNav._childNavDepth;
}
else
_childNav = null;
#if DEBUG
Trace( () => string.Format( "MoveTo( N#{0} )", other.GetHashCode() ) );
#endif
if( _context.DetectLoops )
_navigationStack = (Stack)otherNav._navigationStack.Clone();
return true;
}
示例3: IsSamePosition
/// <summary>
/// See <see cref="System.Xml.XPath.XPathNavigator.IsSamePosition" /> for details.
/// </summary>
/// <returns>Returns <see langword="true"/> if this navigator is positioned
/// at the same node as other navigator, and <see langword="false"/>
/// otherwise.</returns>
public override bool IsSamePosition(XPathNavigator other)
{
#if DEBUG
Trace(() => string.Format("IsSamePosition( N#{0} )", other.GetHashCode()));
#endif
ObjectXPathNavigator x = other as ObjectXPathNavigator;
if (x == null)
{
return false;
}
if (_context != x._context)
return false;
// Compare child navigators
if (_childNav != null)
{
if (x._childNav != null)
// Both child navigators are not null
return _childNav.IsSamePosition(x._childNav);
else
// Our navigator is not null, but other is null;
return false;
}
else if (x._childNav != null)
// In case if our navigator is null and other is not.
return false;
if (_node != x._node)
return false;
return true;
}