当前位置: 首页>>代码示例>>C#>>正文


C# XPathNavigator.GetHashCode方法代码示例

本文整理汇总了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;
        }
开发者ID:AndrewMayorov,项目名称:ObjectXPathNavigator,代码行数:27,代码来源:ObjectXPathNavigator.cs

示例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;
        }
开发者ID:AndrewMayorov,项目名称:ObjectXPathNavigator,代码行数:27,代码来源:ObjectXPathNavigator.cs

示例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;
		}
开发者ID:zanyants,项目名称:mvp.xml,代码行数:39,代码来源:ObjectXPathNavigator.cs


注:本文中的System.Xml.XPath.XPathNavigator.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。