System.Xml.Xsl.Runtime.PrecedingSiblingDocOrderIterator.MoveNext C# (CSharp) Method

MoveNext() public method

Position the iterator on the next preceding-sibling node. Return true if such a node exists and set Current property. Otherwise, return false (Current property is undefined).
public MoveNext ( ) : bool
return bool
        public bool MoveNext() {
            if (this.needFirst) {
                // Get first matching preceding-sibling node
                if (!this.navCurrent.MoveToParent())
                    return false;

                if (!this.filter.MoveToContent(this.navCurrent))
                    return false;

                this.needFirst = false;
            }
            else {
                // Get next matching preceding-sibling node
                if (!this.filter.MoveToFollowingSibling(this.navCurrent))
                    return false;
            }

            // Accept matching sibling only if it precedes navEnd in document order
            if (this.useCompPos)
                return (this.navCurrent.ComparePosition(this.navEnd) == XmlNodeOrder.Before);

            if (this.navCurrent.IsSamePosition(this.navEnd)) {
                // Found the original context node, so iteration is complete.  If MoveNext
                // is called again, use ComparePosition so that false will continue to be
                // returned.
                this.useCompPos = true;
                return false;
            }

            return true;
        }
PrecedingSiblingDocOrderIterator