Esempio n. 1
0
		private void StatusLabelLeft_StartDownload( object sender, EventArgs e ) {
			statusBar.Invoke(() => {
				statusLabelLeft.IsLink = false;
			});
			Downloader downloader = new Downloader();
			downloader.UpdateDownloadEvent += Downloader_ProgressChangedEvent;
			downloader.Download(updater.LatestVersion);
		}
Esempio n. 2
0
		private void Downloader_ProgressChangedEvent( int progress, Downloader.DownloadEventArgs e ) {
			string text = string.Format("Download {0}{1}",
				(progress < 100) ? progress.ToString() : "complete. Click to start Update.",
				(progress < 100) ? "%" : ""
			);
			statusBar.Invoke(() => {
				statusLabelLeft.Text = text;
				statusLabelLeft.LinkColor = colorDefault;
				statusLabelLeft.Image = IconsGeneral.fa_download_16;
			});
			if (progress == 100) {
				InstallerFileName = e.LocalFile;
				statusBar.Invoke(() => {
					statusLabelLeft.IsLink = true;
					statusLabelLeft.LinkColor = colorSuccess;
					statusLabelLeft.Image = IconsGeneral.fa_check_square_o_16;
				});
				statusLabelLeft.Click -= StatusLabelLeft_StartDownload;
				statusLabelLeft.Click += StatusLabelLeft_ExecuteUpdate;
			}
		}