Ejemplo n.º 1
0
        public override bool MoveNext()
        {
tryAgain:
            if (idx >= array.Length || state.IsStopped())
            {
                activity.ChainComplete();
                return(false);
            }

            state = activity.ProcessNext(array[idx++]);
            if (!state.IsFlowing())
            {
                goto tryAgain;
            }

            return(true);
        }
        public override bool MoveNext()
        {
            if (enumerable != null)
            {
                enumerator = enumerable.GetEnumerator();
                enumerable = null;
            }

tryAgain:
            if (!enumerator.MoveNext() || state.IsStopped())
            {
                activity.ChainComplete();
                return(false);
            }

            state = activity.ProcessNext(enumerator.Current);
            if (!state.IsFlowing())
            {
                goto tryAgain;
            }

            return(true);
        }