void fileDownloader_Failed(object sender, DownloadEventArgs e) { if (DialogResult.Retry == MessageBox.Show(e.Message, "Download Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)) // Retry download fileDownloader.Download(); this.Invoke((MethodInvoker)(() => { this.progressPanel.Visible = false; })); }
void fileDownloader_Success(object sender, DownloadEventArgs e) { this.Invoke((MethodInvoker)(() => { this.progress.Value = progress.Maximum; })); if (DialogResult.OK == MessageBox.Show(e.Message, "Youtube", MessageBoxButtons.OK, MessageBoxIcon.Information)) { // save data to disk fileDownloader.Save(); fileDownloader.Refresh(); } this.Invoke((MethodInvoker)(() => { this.progressPanel.Visible = false; })); }