Exemplo n.º 1
0
 // Token: 0x0600011D RID: 285 RVA: 0x0000DFE8 File Offset: 0x0000C1E8
 public static async void smethod_3(JObject jobject_0)
 {
     try
     {
         List <Task> list = new List <Task>();
         using (IEnumerator <JToken> enumerator = jobject_0.Values().GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Class26.Class27 @class = new Class26.Class27();
                 @class.jtoken_0 = enumerator.Current;
                 if (Class130.dictionary_0.ContainsKey((int)@class.jtoken_0["id"]) && !Class130.dictionary_0[(int)@class.jtoken_0["id"]].bool_1)
                 {
                     list.Add(Task.Run(new Action(@class.method_0)));
                     if (list.Count >= 10)
                     {
                         TaskAwaiter taskAwaiter = Task.WhenAll(list).GetAwaiter();
                         if (!taskAwaiter.IsCompleted)
                         {
                             await       taskAwaiter;
                             TaskAwaiter taskAwaiter2;
                             taskAwaiter  = taskAwaiter2;
                             taskAwaiter2 = default(TaskAwaiter);
                         }
                         taskAwaiter.GetResult();
                         list.Clear();
                     }
                 }
             }
         }
         IEnumerator <JToken> enumerator = null;
         list = null;
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
        // Token: 0x06000120 RID: 288 RVA: 0x0000E024 File Offset: 0x0000C224
        void IAsyncStateMachine.MoveNext()
        {
            int num2;
            int num = num2;

            try
            {
                try
                {
                    if (num != 0)
                    {
                        list       = new List <Task>();
                        enumerator = jobject_0.Values().GetEnumerator();
                    }
                    try
                    {
                        TaskAwaiter taskAwaiter3;
                        if (num == 0)
                        {
                            taskAwaiter3 = taskAwaiter2;
                            taskAwaiter2 = default(TaskAwaiter);
                            int num3 = -1;
                            num  = -1;
                            num2 = num3;
                            goto IL_108;
                        }
IL_DC:
                        while (enumerator.MoveNext())
                        {
                            Class26.Class27 @class = new Class26.Class27();
                            @class.jtoken_0 = enumerator.Current;
                            if (Class130.dictionary_0.ContainsKey((int)@class.jtoken_0["id"]) && !Class130.dictionary_0[(int)@class.jtoken_0["id"]].bool_1)
                            {
                                list.Add(Task.Run(new Action(@class.method_0)));
                                if (list.Count >= 10)
                                {
                                    taskAwaiter3 = Task.WhenAll(list).GetAwaiter();
                                    if (taskAwaiter3.IsCompleted)
                                    {
                                        goto IL_108;
                                    }
                                    int num4 = 0;
                                    num          = 0;
                                    num2         = num4;
                                    taskAwaiter2 = taskAwaiter3;
                                    this.asyncVoidMethodBuilder_0.AwaitUnsafeOnCompleted <TaskAwaiter, Class26.Struct23>(ref taskAwaiter3, ref this);
                                    return;
                                }
                            }
                        }
                        goto IL_156;
IL_108:
                        taskAwaiter3.GetResult();
                        list.Clear();
                        goto IL_DC;
                    }
                    finally
                    {
                        if (num < 0 && enumerator != null)
                        {
                            enumerator.Dispose();
                        }
                    }
IL_156:
                    enumerator = null;
                    list       = null;
                }
                catch
                {
                }
            }
            catch (Exception exception)
            {
                num2 = -2;
                this.asyncVoidMethodBuilder_0.SetException(exception);
                return;
            }
            num2 = -2;
            this.asyncVoidMethodBuilder_0.SetResult();
        }