Mvp.Xml.Common.XPath.XPathNavigatorIterator.Add C# (CSharp) Méthode

Add() public méthode

Adds a IEnumerable<XPathNavigator> containing a set of navigators to add.
public Add ( IEnumerable navigators ) : void
navigators IEnumerable The set of navigators to add. Each one is cloned automatically.
Résultat void
        public void Add(IEnumerable<XPathNavigator> navigators)
        {
            if (_position != -1)
                throw new InvalidOperationException(
                    Monobjc.Tools.Sdp.Properties.Resources.XPathNavigatorIterator_CantAddAfterMove);

            foreach (XPathNavigator navigator in navigators)
            {
                _navigators.Add(navigator.Clone());
            }
        }

Same methods

XPathNavigatorIterator::Add ( XPathNavigator navigator ) : void
XPathNavigatorIterator::Add ( XPathNodeIterator iterator ) : void

Usage Example

Exemple #1
0
        /// <summary>
        /// Implements an optimized algorithm for the following function 
        ///    node-set difference(node-set, node-set) 
        /// Uses document identification and binary search,
        /// based on the fact that a node-set is always in document order.
        /// </summary>
        /// <param name="nodeset1">An input nodeset</param>
        /// <param name="nodeset2">Another input nodeset</param>
        /// <returns>The those nodes that are in the node set 
        /// passed as the first argument that are not in the node set 
        /// passed as the second argument.</returns>
        /// <author>Dimitre Novatchev</author>

        private XPathNodeIterator difference2(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2)
        {
            List<Pair> arDocs = new List<Pair>();

            List<XPathNavigator> arNodes2 = new List<XPathNavigator>(nodeset2.Count);

            while (nodeset2.MoveNext())
            {
                arNodes2.Add(nodeset2.Current.Clone());
            }

            auxEXSLT.findDocs(arNodes2, arDocs);

            XPathNavigatorIterator enlResult = new XPathNavigatorIterator();

            while (nodeset1.MoveNext())
            {
                XPathNavigator currNode = nodeset1.Current;

                if (!auxEXSLT.findNode(arNodes2, arDocs, currNode))
                    enlResult.Add(currNode.Clone());
            }

            enlResult.Reset();
            return enlResult;
        }
All Usage Examples Of Mvp.Xml.Common.XPath.XPathNavigatorIterator::Add