/// <summary> /// Resume all agent tasks safely. /// </summary> internal void Resume() { if (CurrentPacakge == null || CurrentPacakge.State != PackageState.Paused) { return; } CurrentPacakge.State = PackageState.Downloading; ParentDownloder.State = DownloaderState.Resumed; DownloadSpeedTracker.Start(); ParentDownloder.CallDownloadResume(CurrentPacakge); }
/// <summary> /// Begin all agent tasks safely. /// </summary> internal async void Begin() { if (PackageList.Count == 0) { return; } System.Console.WriteLine("Devhus.Downloader is beginning..."); State = AgentState.Busy; ParentDownloder.State = DownloaderState.Started; ParentDownloder.CallDownloadBegin(); DownloadSpeedTracker.Start(); await StartDownloading(); }