public void DownloadFileListAsync(DownloadInfoCollection filelist, object userToken)
 {
     if (!this.IsBusy)
     {
         if (!filelist.IsEmpty)
         {
             DownloadInfo item = filelist.TakeFirst();
             this.DownloadFileAsyncEx(item.URL, item.Filename, new DownloadAsyncWrapper(filelist, userToken));
         }
     }
 }
 private void SeekActionDerpian(DownloadAsyncWrapper info, AsyncCompletedEventArgs e, object token)
 {
     if ((info != null) && (!info.filelist.IsEmpty))
     {
         DownloadInfo item = info.filelist.TakeFirst();
         if (item == null)
         {
             this.OnDownloadFileCompleted(new AsyncCompletedEventArgs(e.Error, e.Cancelled, token));
             return;
         }
         this.OnDownloadFileProgressChanged(new DownloadFileProgressChangedEventArgs(info.filelist.CurrentItemCount, info.filelist.Count));
         this.DownloadFileAsyncEx(item.URL, item.Filename, info);
     }
     else
     {
         this.OnDownloadFileCompleted(new AsyncCompletedEventArgs(e.Error, e.Cancelled, token));
     }
 }
Example #3
0
 public void Add(DownloadInfo item)
 {
     this.Count++;
     this.myList.Enqueue(item);
 }