private void download_completed(object sender, AsyncCompletedEventArgs e) { this.fProgressScreen.Hide(); this.fProgressScreen = null; base.DialogResult = System.Windows.Forms.DialogResult.OK; base.Close(); }
private void start_download(PremadeForm.Adventure adv, string filename) { this.fProgressScreen = new ProgressScreen("Downloading Adventure...", 100) { CurrentSubAction = adv.Name }; this.fProgressScreen.Show(); WebClient webClient = new WebClient(); webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(this.progress_changed); webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(this.download_completed); webClient.DownloadFileAsync(new Uri(adv.URL), filename); this.fDownloadedFileName = filename; }