private void ActivateScenarioStatsCp() { FrmQreMain.ActiveScreen.EnableNavigation(); ActionUtils.SetContentScreen(btnScenarioStats, new CpScenarioStats()); if (_progressCp != null) { _progressCp.Dispose(); } }
private void btnScenario2_Click(object sender, EventArgs e) { try { ActionUtils.SetContentScreen((Button)sender, new CpSafetyScenario2()); } catch (Exception ex) { MessageBox.Show("Action failed with this error: " + ex.Message); } }
private void btnQrad_Click(object sender, EventArgs e) { try { ActionUtils.SetContentScreen((Button)sender, new CpFlQradSingleAndMulti()); } catch (Exception ex) { MessageBox.Show("Action failed with this error: " + ex.Message); } }
private void btnDefaultDatabase_Click(object sender, EventArgs e) { btnDefaultDatabase.ForeColor = Color.Green; try { ActionUtils.SetContentScreen((Button)sender, new CpDefaultsDatabase()); } catch (Exception ex) { MessageBox.Show("Action failed with this error: " + ex.Message); } }
/// <summary> /// Set up progress screen and execute analysis task. /// Callback will be called once analysis is complete. /// </summary> /// <param name="sender"></param> private void PrepForAnalysis(Button sender) { try { UiStateRoutines.UnselectButtons(FindForm()); _progressCp = new ProgressDisplay(); ActionUtils.SetContentScreen(sender, _progressCp); FrmQreMain.ActiveScreen.DisableNavigation(); // ugly way to ensure user can't navigate away _analysisToken = new CancellationTokenSource(); //var StartTime = DateTime.Now; var task = Task.Factory.StartNew(ConductAnalysis, _analysisToken.Token); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show("Action failed with this error: " + ex.Message); } }