System.Xml.Xsl.Runtime.DodSequenceMerge.InsertSequence C# (CSharp) Méthode

InsertSequence() private méthode

Insert the specified sequence into the list of sequences to be merged. Insert it in reverse document order with respect to the current nodes in other sequences.
private InsertSequence ( IEnumerator sequence ) : void
sequence IEnumerator
Résultat void
        private void InsertSequence(IEnumerator<XPathNavigator> sequence) {
            for (int i = this.sequencesToMerge.Count - 1; i >= 0; i--) {
                int cmp = this.runtime.ComparePosition(sequence.Current, this.sequencesToMerge[i].Current);

                if (cmp == -1) {
                    // Insert after current item
                    this.sequencesToMerge.Insert(i + 1, sequence);
                    return;
                }
                else if (cmp == 0) {
                    // Found duplicate, so skip the duplicate
                    if (!sequence.MoveNext()) {
                        // No more nodes, so don't insert anything
                        return;
                    }

                    // Next node must be after current node in document order, so don't need to reset loop
                }
            }

            // Insert at beginning of list
            this.sequencesToMerge.Insert(0, sequence);
        }
    }