Move Next on Multiple Name Iterators

178 Views Asked by At

I have two XPathNodeIterator nodeI1 and nodeI2.

I have a loop which should go through each while(nodeI1.MoveNext())

How can I get this loop to automatically start nodeI2.MoveNext() after nodeI1 is done? I don't want to copy paste all the code and make another while loop.

1

There are 1 best solutions below

1
On BEST ANSWER

One straightforward way is to put your loop into a method that takes in a node. Then call it twice.