private void DownloadServiceOnDownloadCancel(object sender, MyDownloadEventArgs myDownloadEventArgs) { Download.State = CurrentDownloadState.Cancel; Debug.WriteLine("Download cancel"); DownloadCancel?.Invoke(sender, myDownloadEventArgs); }
private void DownloadServiceOnDownloadComplete(object sender, MyDownloadEventArgs myDownloadEventArgs) { CurrentProgress = 1.0; Download.State = CurrentDownloadState.Finish; Debug.WriteLine("Download finisch"); DownloadComplete?.Invoke(sender, myDownloadEventArgs); }
private void DownloadServiceOnDownloadProgressChanged(object sender, MyDownloadEventArgs myDownloadEventArgs) { DownloadTracker.SetProgress(myDownloadEventArgs.CurrentFileSize, myDownloadEventArgs.TotalFileSize); DownloadSpeed = DownloadTracker.GetBytesPerSecond(); DownloadSpeedAsString = DownloadTracker.GetBytesPerSecondString(); CurrentProgress = DownloadTracker.GetProgress(); DownloadProgressChanged?.Invoke(sender, myDownloadEventArgs); }
private void DownloadComplete(object sender, MyDownloadEventArgs eventArgs) { FilesDownloaded++; SetFilesToDownloadProgress(); TotalDownloadProgress = FilesDownloaded / TotalFilesToDownload; if (Downloads.All(x => x.Download.State == CurrentDownloadState.Finish)) { AllDownloadsComplete(); } }
private void DownloadServiceOnDownloadPause(object sender, MyDownloadEventArgs myDownloadEventArgs) { DownloadPause?.Invoke(sender, myDownloadEventArgs); }
private void DownloadProgressChanged(object sender, MyDownloadEventArgs eventArgs) { TotalDownloadSpeed = +Downloads.Select(x => x) .Where(x => x.Download.State == CurrentDownloadState.Download) .Select(x => x.GetBytesPerSecondAsUnit()).Sum(); }
private void ShowCancelDialoge(object sender, MyDownloadEventArgs args) { _show.Message(Ressources.DownloaderViewModel.CancelDownload); }