Пример #1
0
 private void _worker_DoWork(object sender, DoWorkEventArgs e)
 {
     this._currentBytes = (long)0;
     this._current      = 0;
     this._totalBytes   = (long)0;
     this._downloadQueue.Clear();
     for (int i = this.PacksQueue.Count - 1; i >= 0; i--)
     {
         IEnumerable <Download> downloadList = PacksDownloader.GetDownloadList(this.PacksQueue[i]);
         Download[]             array        = downloadList as Download[] ?? downloadList.ToArray <Download>();
         if (array.Any <Download>())
         {
             Download[] downloadArray = array;
             for (int j = 0; j < (int)downloadArray.Length; j++)
             {
                 Download download = downloadArray[j];
                 this._downloadQueue.Add(download);
             }
         }
         else
         {
             this.PacksQueue.RemoveAt(i);
         }
         if (this._worker.CancellationPending)
         {
             e.Cancel = true;
             return;
         }
     }
     this._downloadQueue.Reverse();
     foreach (Download download1 in this._downloadQueue)
     {
         PacksDownloader fileSize = this;
         fileSize._totalBytes = fileSize._totalBytes + download1.FileSize;
     }
     this._downloadCount = this._downloadQueue.Count;
 }
Пример #2
0
 public static bool HasUpdates(VoicePack pack)
 {
     return(PacksDownloader.GetDownloadList(pack).Any <Download>());
 }