Ejemplo n.º 1
0
 public abstract void StopDownload(PreparedDownload download);
Ejemplo n.º 2
0
 private void StartDownloadUnsafe(PreparedDownload download)
 {
     if (!registered.Contains(download))
     {
         download.StateChanged += dl_StateChanged;
         registered.Add(download);
         DownloadsAdded.RaiseEvent(this, new[] { download });
     }
     Directory.CreateDirectory(Path.GetDirectoryName(download.FilePath));
     active.Add(download);
     download.State = DownloadState.Active;
     download.Item.Module.StartDownload(download);
 }
Ejemplo n.º 3
0
 public void StopDownload(PreparedDownload download)
 {
     download.Item.Module.StopDownload(download);
     download.State = DownloadState.Stopped;
 }
Ejemplo n.º 4
0
 private void RemoveActive(PreparedDownload download)
 {
     lock (active)
     {
         PreparedDownload dl;
         while (active.Contains(download))
         {
             if (active.TryTake(out dl))
             {
                 break;
             }
         }
     }
     ProcessQueue();
 }
Ejemplo n.º 5
0
 public void StartDownload(PreparedDownload download)
 {
     lock (active)
     {
         StartDownloadUnsafe(download);
     }
 }