Ejemplo n.º 1
0
            public void MoveNext()
            {
                if (state == 0)
                {
                    awaiter = CustomAsync().GetAwaiter();
                    if (!awaiter.IsCompleted)
                    {
                        state = 1;
                        awaiter.OnCompleted(MoveNext);
                        return;
                    }
                }
                string result = awaiter.GetResult();

                Console.WriteLine(result);
            }
Ejemplo n.º 2
0
            private static void TheRest(MyAwaitableType.MinimalAwaiter awaiter)
            {
                string result = awaiter.GetResult();

                Console.WriteLine(result);
            }