public void SimControlPauseScenario() { if (scenarioState != ScenarioState.STOPPED) { if (scenarioState == ScenarioState.PAUSED) {//un-pause scenarioState = ScenarioState.RUNNING; simEngine.Resume(); } else {//pause scenarioState = ScenarioState.PAUSED; simEngine.Pause(); } } if (replayState != ScenarioState.STOPPED) { if (replayState == ScenarioState.PAUSED) {//un-pause replayState = ScenarioState.RUNNING; simEngine.Resume(); } else {//pause replayState = ScenarioState.PAUSED; simEngine.Pause(); } } }
private void pauseButton_Click(object sender, EventArgs e) { paused = !paused; if (paused) { pauseButton.Text = "Resume"; simEngine.Pause(); } else { pauseButton.Text = "Pause"; simEngine.Resume(); } }