HtmlAgilityPack.HtmlNodeNavigator.MoveTo C# (CSharp) Method

MoveTo() public method

Moves to the same position as the specified HtmlNavigator.
public MoveTo ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator The HtmlNavigator positioned on the node that you want to move to.
return bool
        public override bool MoveTo(XPathNavigator other)
        {
            HtmlNodeNavigator nav = other as HtmlNodeNavigator;
            if (nav == null)
            {
                InternalTrace(">false (nav is not an HtmlNodeNavigator)");
                return false;
            }
            InternalTrace("moveto oid=" + nav.GetHashCode()
                          + ", n:" + nav._currentnode.Name
                          + ", a:" + nav._attindex);

            if (nav._doc == _doc)
            {
                _currentnode = nav._currentnode;
                _attindex = nav._attindex;
                InternalTrace(">true");
                return true;
            }
            // we don't know how to handle that
            InternalTrace(">false (???)");
            return false;
        }