Reset() public method

Remove all navigators from the stack
public Reset ( ) : void
return void
Exemplo n.º 1
0
        private void PushAncestors()
        {
            _navStack.Reset();
            do
            {
                _navStack.Push(_navCurrent.Clone());
            }while (_navCurrent.MoveToParent());

            // Pop the root of the tree, since MoveToFollowing calls will never return it
            _navStack.Pop();
        }
Exemplo n.º 2
0
        private void PushAncestors()
        {
            Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext);

            _navStack.Reset();
            do
            {
                _navStack.Push(_navCurrent.Clone());
            }while (_navCurrent.MoveToParent());

            // Pop the root of the tree, since MoveToFollowing calls will never return it
            _navStack.Pop();
        }
Exemplo n.º 3
0
        public void Create(XPathNavigator context, XmlNavigatorFilter filter)
        {
            XPathPrecedingDocOrderIterator wrapped = default;

            wrapped.Create(context, filter);
            _stack.Reset();

            // Fetch all preceding nodes in document order and push them onto the stack
            while (wrapped.MoveNext())
            {
                _stack.Push(wrapped.Current.Clone());
            }
        }
Exemplo n.º 4
0
        public void Create(XPathNavigator context, XmlNavigatorFilter filter, bool orSelf)
        {
            AncestorIterator wrapped = default;

            wrapped.Create(context, filter, orSelf);
            _stack.Reset();

            // Fetch all ancestor nodes in reverse document order and push them onto the stack
            while (wrapped.MoveNext())
            {
                _stack.Push(wrapped.Current.Clone());
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initialize the NamespaceIterator.
        /// </summary>
        public void Create(XPathNavigator context)
        {
            // Push all of context's in-scope namespaces onto a stack in order to return them in document order
            // (MoveToXXXNamespace methods return namespaces in reverse document order)
            _navStack.Reset();
            if (context.MoveToFirstNamespace(XPathNamespaceScope.All))
            {
                do
                {
                    // Don't return the default namespace undeclaration
                    if (context.LocalName.Length != 0 || context.Value.Length != 0)
                    {
                        _navStack.Push(context.Clone());
                    }
                }while (context.MoveToNextNamespace(XPathNamespaceScope.All));

                context.MoveToParent();
            }
        }
Exemplo n.º 6
0
        public void Create(XPathNavigator context, XmlNavigatorFilter filter)
        {
            // Start at root, which is always first node in the document
            _navCurrent = XmlQueryRuntime.SyncToNavigator(_navCurrent, context);
            _navCurrent.MoveToRoot();
            _stack.Reset();

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

                // Push all matching nodes onto stack
                while (filter.MoveToFollowing(_navCurrent, context))
                {
                    _stack.Push(_navCurrent.Clone());
                }
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Initialize the ContentMergeIterator (merge multiple sets of content nodes in document order and remove duplicates).
 /// </summary>
 public void Create(XmlNavigatorFilter filter)
 {
     _filter = filter;
     _navStack.Reset();
     _state = IteratorState.NeedCurrent;
 }