/// <summary> /// Handles the Click event of the btnRunPrepareSteps control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnRunPrepareSteps_Click(object sender, EventArgs e) { this.toolStripStatusLabel.Text = "Running preparation steps..."; Button btn = (Button)sender; btn.Enabled = false; // Only one scenario is supported at the same time. If rule perf preparation steps are running, then // the rule perf testing steps can't run. And vice versa. this.btnRun.Enabled = false; tmrMonitor.Start(); StepsProcessor.AsyncProcessSteps( GetStepsToBeExecuted(this.dgvPrepareSteps), new RunWorkerCompletedEventHandler((obj, ea) => { tmrMonitor.Stop(); RefreshSteps(DataGridViewAutoSizeColumnsMode.DisplayedCells); this.toolStripStatusLabel.Text = "Preparation steps completed."; this.btnRun.Enabled = true; this.btnRunPrepareSteps.Enabled = true; })); }