System.Xml.Xsl.Runtime.PrecedingIterator.Create C# (CSharp) Method

Create() public method

Initialize the PrecedingIterator (no possibility of duplicates).
public Create ( XPathNavigator context, XmlNavigatorFilter filter ) : void
context System.Xml.XPath.XPathNavigator
filter XmlNavigatorFilter
return void
        public void Create(XPathNavigator context, XmlNavigatorFilter filter) {
            // Start at root, which is always first node in the document
            this.navCurrent = XmlQueryRuntime.SyncToNavigator(this.navCurrent, context);
            this.navCurrent.MoveToRoot();

            // If root node is not the ending node,
            if (!this.navCurrent.IsSamePosition(context)) {
                // Push root onto the stack if it is not filtered
                if (!filter.IsFiltered(this.navCurrent))
                    this.stack.Push(this.navCurrent.Clone());

                // Push all matching nodes onto stack
                while (filter.MoveToFollowing(this.navCurrent, context))
                    this.stack.Push(this.navCurrent.Clone());
            }
        }
PrecedingIterator