public override bool TryNext() { switch (state) { case State.Reset: while (query1.TryNext()) { query2.Reset(); if (query2.TryNext()) { state = State.InProgress; return(true); } } state = State.Exhausted; return(false); case State.InProgress: do { if (query2.TryNext()) { return(true); } query2.Reset(); }while (query1.TryNext()); state = State.Exhausted; return(false); case State.Exhausted: return(false); } return(false); }
public override void Reset() { query1.Reset(); state = State.Reset; }