void downloader_ProgressChanged(object sender, CodeProject.Downloader.DownloadEventArgs e) { // Sometimes we may get events fired even after we're done downloading. // Don't react to them. if (this.state != InstallState.Downloading) { return; } this.Invoke(new EventHandler(delegate { if (e.PercentDone <= 100) { this.progressBar.Value = e.PercentDone; UpdateProgressLabel(e); } })); }
private void DownloadFtp_ProgressChanged(object sender, DownloadEventArgs e) { downloadFtpTestDownloader.Cancel(); }
private void UpdateProgressLabel(DownloadEventArgs e) { // If the total file size is 0, then the downloader doesn't know its progress. Might as well not show it if (e.TotalFileSize == 0 && e.CurrentFileSize == 0) this.labelProgress.Visible = false; else { this.labelProgress.Visible = true; this.labelProgress.Text = DownloadProgressString.ProgressString(e.CurrentFileSize, e.TotalFileSize); MoveControlToTheLeftOf(labelProgress, this.progressBar.Left); } }
private void Cancel_ProgressChanged(object sender, DownloadEventArgs e) { cancelTestDownloader.Cancel(); }