internal void Update() { _updateBackgroundWorker.RunWorkerAsync(); Console.WriteLine("Downloading..."); Tray.ShowBalloonTip("Downloading..."); Form1.GlobalAccess.statusStripStatusLabel.Text = "Downloading..."; Form1.GlobalAccess.statusStripProgressBar.Value = 0; Form1.GlobalAccess.statusStripProgressBar.Visible = true; }
private void Download_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { Form1.GlobalAccess.statusStripProgressBar.Value = 0; Form1.GlobalAccess.statusStripProgressBar.Visible = false; Console.WriteLine("Update Complete!"); Tray.ShowBalloonTip("Update Complete!"); Form1.GlobalAccess.statusStripStatusLabel.Text = "Update Complete!"; Repository.Repositories[listView1.SelectedIndices[0]].RunWorkerCompleted -= Download_RunWorkerCompleted; RefreshAvailableRepositories(); Enabled = true; }
private void DownloadBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { if (!GetCommitFile()) { MessageBox.Show("Either connection failed or repository is not available."); } var repPath = Path.Combine(new[] { Environment.CurrentDirectory, "Repositories", _revisionParser.GetPath() }); if (Directory.Exists(repPath)) { Console.WriteLine("You have latest [{0}] revision: {1}", _revisionParser.DeveloperName, _revisionParser.LastRevision); Tray.ShowBalloonTip(String.Format("You have latest [{0}] revision: {1}", _revisionParser.DeveloperName, _revisionParser.LastRevision)); return; } DeleteHelper.DeleteOldRepoVersion(_revisionParser.DeveloperName); //We delete old repo version. _updateBackgroundWorker.ReportProgress(0); Console.WriteLine("Downloading zip file..."); Tray.ShowBalloonTip("Downloading zip file..."); Form1.GlobalAccess.Invoke( (MethodInvoker)(() => Form1.GlobalAccess.statusStripStatusLabel.Text = "Downloading zip file...")); Download(); _updateBackgroundWorker.ReportProgress(0); Console.WriteLine("Uncompressing zip file..."); Tray.ShowBalloonTip("Uncompressing zip file..."); Form1.GlobalAccess.Invoke( (MethodInvoker)(() => Form1.GlobalAccess.statusStripStatusLabel.Text = "Uncompressing zip file...")); Unzip(); //UnzipShell(); _updateBackgroundWorker.ReportProgress(50); Console.WriteLine("Compiling Mooege..."); Tray.ShowBalloonTip("Compiling Mooege..."); Form1.GlobalAccess.Invoke( (MethodInvoker)(() => Form1.GlobalAccess.statusStripStatusLabel.Text = "Compiling Mooege...")); if (!Compile()) { Console.WriteLine("Error while compiling"); Tray.ShowBalloonTip("Error while compiling"); Form1.GlobalAccess.Invoke( (MethodInvoker)(() => Form1.GlobalAccess.statusStripStatusLabel.Text = "Error while compiling")); MessageBox.Show(Form.ActiveForm, String.Format( "An error occurred while compiling Mooege{0}Check the msbuild.log for further info.", Environment.NewLine), "MadCow", MessageBoxButtons.OK, MessageBoxIcon.Error); } _updateBackgroundWorker.ReportProgress(100); }