In C #, nothing exists to do such a thing.
You are correct IEnumerator The current property is determined as soon as the recipient.
You will need to write a new class and / or interface to support such a thing.
interface IOutputable<T> {
IOutputer<T> GetOutputer();
}
interface IOutputer<T> {
T Current { set; }
bool MoveNext();
void Reset();
}
source
share