private void stopButton_Click(object sender, EventArgs e) { if (state != timerState.stopped) { startButton.Enabled = true; stopButton.Enabled = false; state = timerState.stopped; } }
private void pauseButton_Click(object sender, EventArgs e) { if (state == timerState.running) { startButton.Enabled = true; startButton.Text = "Resume"; pauseButton.Enabled = false; state = timerState.paused; } }
private void autoDismiss(TimeSpan timeout) { var s = new timerState(); var timerDelegate = new TimerCallback(checkTimerState); var timer = new Timer(timerDelegate, s, timeout, timeout); s.tmr = timer; while (s.tmr != null) { Thread.Sleep(0); } }
private void button1_Click(object sender, EventArgs e) { if (state != timerState.running) { if (titleText.Text == "") { MessageBox.Show("Please enter a title."); //Dissalowing empty title field. } else { startButton.Enabled = false; stopButton.Enabled = true; state = timerState.running; } } }
public static void RestoreGameSpeed() { timerState tempState = currentState; currentState = prevState; prevState = tempState; }
public static void PlaySpeed() { prevState = currentState; currentState = timerState.PLAY; }
public static void PauseGame() { prevState = currentState; currentState = timerState.PAUSED; }
public static void DoubleTime() { prevState = currentState; currentState = timerState.DOUBLE; }