1using System.Collections;
2using System.Threading.Tasks;
15 private readonly
int nrEnumerators;
16 private int position = 0;
25 this.enumerators = Enumerators;
26 this.nrEnumerators = this.enumerators.Length;
32 public T
Current => this.enumerators[this.position].Current;
37 object IEnumerator.Current => this.enumerators[this.position].Current;
46 for (i = 0; i < this.nrEnumerators; i++)
56 while (this.position < this.nrEnumerators)
58 if (this.enumerators[this.position].
MoveNext())
73 while (this.position < this.nrEnumerators)
91 for (i = 0; i <= this.position; i++)
92 this.enumerators[i].
Reset();
Joins a set of enumerators into one, that enumerates the items of each consequitively.
bool MoveNext()
Moves to the next item.
void Dispose()
Disposes of the enumerator, and all embedded enumerators.
async Task< bool > MoveNextAsync()
Moves to the next item.
void Reset()
Resets the enumerator, and corresponding embedded enumerators.
UnionEnumerator(params IAsyncEnumerator< T >[] Enumerators)
Joins a set of enumerators into one, that enumerates the items of each consequitively.
Interface for asynchronous enumerators.