當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。