Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public override void Reset()
 {
     query1.Reset();
     state = State.Reset;
 }