示例#1
0
        // Token: 0x060017D8 RID: 6104 RVA: 0x00059480 File Offset: 0x00057680
        private static Loader Deserialize(Reader reader, IDownloaderDispatch dispatch)
        {
            List <Item[]> list  = new List <Item[]>();
            List <Item>   list2 = new List <Item>();

            while (reader.Read())
            {
                switch (reader.Token)
                {
                case Token.RandomLoadOrderAreaBegin:
                    list2.Clear();
                    break;

                case Token.BundleListing:
                    list2.Add(reader.Item);
                    break;

                case Token.RandomLoadOrderAreaEnd:
                    list.Add(list2.ToArray());
                    break;

                case Token.DownloadQueueEnd:
                {
                    Operation operation = new Operation();
                    int       num       = 0;
                    foreach (Item[] array in list)
                    {
                        num += array.Length;
                    }
                    Job[] array2 = new Job[num];
                    int   num2   = 0;
                    foreach (Item[] array3 in list)
                    {
                        foreach (Item item in array3)
                        {
                            array2[num2++] = new Job
                            {
                                _op  = operation,
                                Item = item
                            };
                        }
                    }
                    Group group = new Group();
                    group._op  = operation;
                    group.Jobs = array2;
                    group.Initialize();
                    Group[] array5 = new Group[list.Count];
                    int     num3   = 0;
                    int     num4   = 0;
                    foreach (Item[] array6 in list)
                    {
                        int   num5   = array6.Length;
                        Job[] array7 = new Job[num5];
                        for (int j = 0; j < num5; j++)
                        {
                            array7[j] = array2[num3++];
                        }
                        array5[num4]      = new Group();
                        array5[num4]._op  = operation;
                        array5[num4].Jobs = array7;
                        array5[num4].Initialize();
                        for (int k = 0; k < num5; k++)
                        {
                            array7[k].Group = array5[num4];
                        }
                        num4++;
                    }
                    return(operation.Loader = new Loader(group, array2, array5, dispatch));
                }
                }
            }
            throw new InvalidProgramException();
        }
示例#2
0
 private static Loader Deserialize(Reader reader, IDownloaderDispatch dispatch)
 {
     List<Item[]> itemArrays = new List<Item[]>();
     List<Item> items = new List<Item>();
     while (reader.Read())
     {
         switch (reader.Token)
         {
             case Token.RandomLoadOrderAreaBegin:
             {
                 items.Clear();
                 continue;
             }
             case Token.BundleListing:
             {
                 items.Add(reader.Item);
                 continue;
             }
             case Token.RandomLoadOrderAreaEnd:
             {
                 itemArrays.Add(items.ToArray());
                 continue;
             }
             case Token.DownloadQueueEnd:
             {
                 Operation operation = new Operation();
                 int length = 0;
                 foreach (Item[] itemArray in itemArrays)
                 {
                     length = length + (int)itemArray.Length;
                 }
                 Job[] jobArray = new Job[length];
                 int num = 0;
                 foreach (Item[] itemArray1 in itemArrays)
                 {
                     Item[] itemArray2 = itemArray1;
                     for (int i = 0; i < (int)itemArray2.Length; i++)
                     {
                         Item item = itemArray2[i];
                         int num1 = num;
                         num = num1 + 1;
                         Job job = new Job()
                         {
                             _op = operation,
                             Item = item
                         };
                         jobArray[num1] = job;
                     }
                 }
                 Group group = new Group()
                 {
                     _op = operation,
                     Jobs = jobArray
                 };
                 group.Initialize();
                 Group[] groupArray = new Group[itemArrays.Count];
                 int num2 = 0;
                 int num3 = 0;
                 foreach (Item[] itemArray3 in itemArrays)
                 {
                     int length1 = (int)itemArray3.Length;
                     Job[] jobArray1 = new Job[length1];
                     for (int j = 0; j < length1; j++)
                     {
                         int num4 = num2;
                         num2 = num4 + 1;
                         jobArray1[j] = jobArray[num4];
                     }
                     groupArray[num3] = new Group();
                     groupArray[num3]._op = operation;
                     groupArray[num3].Jobs = jobArray1;
                     groupArray[num3].Initialize();
                     for (int k = 0; k < length1; k++)
                     {
                         jobArray1[k].Group = groupArray[num3];
                     }
                     num3++;
                 }
                 Loader loader = new Loader(group, jobArray, groupArray, dispatch);
                 Loader loader1 = loader;
                 operation.Loader = loader;
                 return loader1;
             }
             default:
             {
                 continue;
             }
         }
     }
     throw new InvalidProgramException();
 }
示例#3
0
        private static Loader Deserialize(Reader reader, IDownloaderDispatch dispatch)
        {
            List <Item[]> list  = new List <Item[]>();
            List <Item>   list2 = new List <Item>();

            while (reader.Read())
            {
                switch (reader.Token)
                {
                case Token.RandomLoadOrderAreaBegin:
                    list2.Clear();
                    break;

                case Token.BundleListing:
                    list2.Add(reader.Item);
                    break;

                case Token.RandomLoadOrderAreaEnd:
                    list.Add(list2.ToArray());
                    break;

                case Token.DownloadQueueEnd:
                {
                    Operation operation = new Operation();
                    int       num       = 0;
                    foreach (Item[] itemArray in list)
                    {
                        num += itemArray.Length;
                    }
                    Job[] allJobs = new Job[num];
                    int   num2    = 0;
                    foreach (Item[] itemArray2 in list)
                    {
                        foreach (Item item in itemArray2)
                        {
                            Job job = new Job {
                                _op  = operation,
                                Item = item
                            };
                            allJobs[num2++] = job;
                        }
                    }
                    Group masterGroup = new Group {
                        _op  = operation,
                        Jobs = allJobs
                    };
                    masterGroup.Initialize();
                    Group[] allGroups = new Group[list.Count];
                    int     num4      = 0;
                    int     index     = 0;
                    foreach (Item[] itemArray4 in list)
                    {
                        int   length    = itemArray4.Length;
                        Job[] jobArray2 = new Job[length];
                        for (int i = 0; i < length; i++)
                        {
                            jobArray2[i] = allJobs[num4++];
                        }
                        allGroups[index]      = new Group();
                        allGroups[index]._op  = operation;
                        allGroups[index].Jobs = jobArray2;
                        allGroups[index].Initialize();
                        for (int j = 0; j < length; j++)
                        {
                            jobArray2[j].Group = allGroups[index];
                        }
                        index++;
                    }
                    return(operation.Loader = new Loader(masterGroup, allJobs, allGroups, dispatch));
                }
                }
            }
            throw new InvalidProgramException();
        }
示例#4
0
        private static Loader Deserialize(Reader reader, IDownloaderDispatch dispatch)
        {
            List <Item[]> itemArrays = new List <Item[]>();
            List <Item>   items      = new List <Item>();

            while (reader.Read())
            {
                switch (reader.Token)
                {
                case Token.RandomLoadOrderAreaBegin:
                {
                    items.Clear();
                    continue;
                }

                case Token.BundleListing:
                {
                    items.Add(reader.Item);
                    continue;
                }

                case Token.RandomLoadOrderAreaEnd:
                {
                    itemArrays.Add(items.ToArray());
                    continue;
                }

                case Token.DownloadQueueEnd:
                {
                    Operation operation = new Operation();
                    int       length    = 0;
                    foreach (Item[] itemArray in itemArrays)
                    {
                        length = length + (int)itemArray.Length;
                    }
                    Job[] jobArray = new Job[length];
                    int   num      = 0;
                    foreach (Item[] itemArray1 in itemArrays)
                    {
                        Item[] itemArray2 = itemArray1;
                        for (int i = 0; i < (int)itemArray2.Length; i++)
                        {
                            Item item = itemArray2[i];
                            int  num1 = num;
                            num = num1 + 1;
                            Job job = new Job()
                            {
                                _op  = operation,
                                Item = item
                            };
                            jobArray[num1] = job;
                        }
                    }
                    Group group = new Group()
                    {
                        _op  = operation,
                        Jobs = jobArray
                    };
                    group.Initialize();
                    Group[] groupArray = new Group[itemArrays.Count];
                    int     num2       = 0;
                    int     num3       = 0;
                    foreach (Item[] itemArray3 in itemArrays)
                    {
                        int   length1   = (int)itemArray3.Length;
                        Job[] jobArray1 = new Job[length1];
                        for (int j = 0; j < length1; j++)
                        {
                            int num4 = num2;
                            num2         = num4 + 1;
                            jobArray1[j] = jobArray[num4];
                        }
                        groupArray[num3]      = new Group();
                        groupArray[num3]._op  = operation;
                        groupArray[num3].Jobs = jobArray1;
                        groupArray[num3].Initialize();
                        for (int k = 0; k < length1; k++)
                        {
                            jobArray1[k].Group = groupArray[num3];
                        }
                        num3++;
                    }
                    Loader loader  = new Loader(group, jobArray, groupArray, dispatch);
                    Loader loader1 = loader;
                    operation.Loader = loader;
                    return(loader1);
                }

                default:
                {
                    continue;
                }
                }
            }
            throw new InvalidProgramException();
        }