private void StableDowngrade_Click(object sender, EventArgs e) { //Clean up before and after yourself in case of unwanted additional hash/deltas Changer.Cleanup(); //Default path for latest updated (in this case files_1.80) ProgressWindow window = new ProgressWindow(new Tuple <string, string>(@Properties.Settings.Default.pathStable, armaText.Text)); window.ShowDialog(); Changer.Cleanup(); }
private void PauseButton_Click(object sender, EventArgs e) { //Flip between pause and resume if (!toggle) { pauseButton.Text = "Resume"; Changer.PauseThread(); } else { pauseButton.Text = "Pause"; Changer.ResumeThread(); } toggle = !toggle; }
private void CancelButton_Click(object sender, EventArgs e) { bool toggleCopy = toggle; if (!toggleCopy) { Changer.PauseThread(); toggleCopy = true; } if (MessageBox.Show("Are you sure you want to cancel?\nOperations in progress will complete and exit", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //In case thread is paused, resume it so it can stop gracefully Changer.ResumeThread(); //Send cancel request to threads bgWorker.CancelAsync(); DialogResult = DialogResult.OK; } else if (toggleCopy) { Changer.ResumeThread(); } }