Пример #1
0
 private void stopButton_Click(object sender, EventArgs e)
 {
     if (state != timerState.stopped)
     {
         startButton.Enabled = true;
         stopButton.Enabled  = false;
         state = timerState.stopped;
     }
 }
Пример #2
0
 private void pauseButton_Click(object sender, EventArgs e)
 {
     if (state == timerState.running)
     {
         startButton.Enabled = true;
         startButton.Text    = "Resume";
         pauseButton.Enabled = false;
         state = timerState.paused;
     }
 }
Пример #3
0
        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);
            }
        }
Пример #4
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;
         }
     }
 }
Пример #5
0
 public static void RestoreGameSpeed()
 {
     timerState tempState = currentState;
     currentState = prevState;
     prevState = tempState;
 }
Пример #6
0
 public static void PlaySpeed()
 {
     prevState = currentState;
     currentState = timerState.PLAY;
 }
Пример #7
0
 public static void PauseGame()
 {
     prevState = currentState;
     currentState = timerState.PAUSED;
 }
Пример #8
0
    public static void DoubleTime()
    {
        prevState = currentState;

        currentState = timerState.DOUBLE;
    }