Exemplo n.º 1
0
        // Token: 0x06000080 RID: 128 RVA: 0x0000AA18 File Offset: 0x00008C18
        void IAsyncStateMachine.MoveNext()
        {
            int num = this.int_0;

            try
            {
                TaskAwaiter <string> awaiter;
                if (num != 0)
                {
                    awaiter = Class138.smethod_1(File.OpenRead("audio.mp3")).GetAwaiter();
                    if (!awaiter.IsCompleted)
                    {
                        this.int_0         = 0;
                        this.taskAwaiter_0 = awaiter;
                        this.asyncVoidMethodBuilder_0.AwaitUnsafeOnCompleted <TaskAwaiter <string>, MainWindow.Struct0>(ref awaiter, ref this);
                        return;
                    }
                }
                else
                {
                    awaiter            = this.taskAwaiter_0;
                    this.taskAwaiter_0 = default(TaskAwaiter <string>);
                    this.int_0         = -1;
                }
                Console.WriteLine(awaiter.GetResult());
            }
            catch (Exception exception)
            {
                this.int_0 = -2;
                this.asyncVoidMethodBuilder_0.SetException(exception);
                return;
            }
            this.int_0 = -2;
            this.asyncVoidMethodBuilder_0.SetResult();
        }
Exemplo n.º 2
0
    // Token: 0x06000070 RID: 112 RVA: 0x0000A478 File Offset: 0x00008678
    public async void method_3()
    {
        TaskAwaiter <string> taskAwaiter = Class138.smethod_1(File.OpenRead("audio.mp3")).GetAwaiter();

        if (!taskAwaiter.IsCompleted)
        {
            await taskAwaiter;
            TaskAwaiter <string> taskAwaiter2;
            taskAwaiter  = taskAwaiter2;
            taskAwaiter2 = default(TaskAwaiter <string>);
        }
        Console.WriteLine(taskAwaiter.GetResult());
    }