I have seen a similar example with loops continuing after the last element to reset to first, which is great. However, I am unable to figure out how to add that PLUS start iterating from a specified index of the IList object.
Assume we have this IList object with a count of 6. (To simplify I'm only using indices below instead of the full objects.)
[1, 2, 3, 4, 5, 6]
Now assume we need to iterate over this IList 10 times.
=> Iterate 10 times
The expected output based on the above should be:
=> 1, 2, 3, 4, 5, 6, 1, 2, 3, 4
However I'd like to start iterating from #4 for example, so the expected output should now be:
=> 4, 5, 6, 1, 2, 3, 4, 5, 6, 1
(All the numbers above represent the position of the elements in the collection, not the actual objects as ints)
Any ideas on how this is possible with LINQ and C#? Please keep in mind that we're working with an IList.