コード例 #1
0
ファイル: PremadeForm.cs プロジェクト: cmdrmander/Manderplan
 private void download_completed(object sender, AsyncCompletedEventArgs e)
 {
     this.fProgressScreen.Hide();
     this.fProgressScreen = null;
     base.DialogResult    = System.Windows.Forms.DialogResult.OK;
     base.Close();
 }
コード例 #2
0
ファイル: PremadeForm.cs プロジェクト: cmdrmander/Manderplan
        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;
        }