/// <summary> /// Execute the next download when a download is finish /// </summary> private void Update() { if (!isWorking && toolBox.testDevice.internet) { if (priorityToDownload.Count > 0) { theDownload = priorityToDownload.Peek(); priorityToDownload.Dequeue(); StartCoroutine(StartDownload(theDownload.url)); } else if (toDownload.Count > 0) { theDownload = toDownload.Peek(); toDownload.Dequeue(); StartCoroutine(StartDownload(theDownload.url)); } } }
private void DownloadNext() { if (ToDownload.Any()) { DownloadEntry next = ToDownload.Dequeue(); webc.DownloadFileAsync(new Uri(next.Url), next.Path); progressBar.Value = progressBar.Maximum - ((ToDownload.Count + 1) * 100); } else { System.Windows.MessageBox.Show("Done"); CanChange = true; progressBar.Value = 0; buttonDownload.Content = "Download"; } }