Beispiel #1
0
 /// <summary>
 /// Starts/Resumes the downloads of this manager
 /// </summary>
 public void Start()
 {
     foreach (var dl in Pending.Take(MaxParallelDownloads - RunningDownloads.Count()))
     {
         dl.StartAsync();
     }
     ApplyDownloadLimits();
 }
Beispiel #2
0
 /// <summary>
 /// Pauses all currently running downloads
 /// </summary>
 public void Pause()
 {
     Console.WriteLine(RunningDownloads.Count());
     foreach (var dl in RunningDownloads)
     {
         dl.Pause();
     }
 }
Beispiel #3
0
        private void ApplyDownloadLimits()
        {
            if (RunningDownloads.Count() < 1)
            {
                return;
            }

            int limit = BandwidthLimit / RunningDownloads.Count();

            foreach (IDownloader dl in RunningDownloads)
            {
                dl.BandwidthLimit = limit;
            }
        }