MS.Internal.Xml.XPath.DescendantQuery.Advance C# (CSharp) Method

Advance() public method

public Advance ( ) : XPathNavigator
return System.Xml.XPath.XPathNavigator
        public override XPathNavigator Advance() {
            while (true) {
                if (nodeIterator == null) {
                    position = 0;
                    XPathNavigator nav = qyInput.Advance();
                    if (nav == null) {
                        return null;
                    }
                    if (NameTest) {
                        if (TypeTest == XPathNodeType.ProcessingInstruction) {
                            nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name);
                        } else {
                            nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf);
                        }
                    } else {
                        nodeIterator = nav.SelectDescendants(TypeTest, matchSelf);
                    }
                }

                if (nodeIterator.MoveNext()) {
                    position++;
                    currentNode = nodeIterator.Current;
                    return currentNode;
                } else {
                    nodeIterator = null;
                }
            }
        }