/// <summary>
        /// Callback to update the time dispay that the time calls each time it ticks
        /// </summary>
        private void UpdateTimeCallback(object?state)
        {
            if (Console.KeyAvailable)
            {
                switch (Console.ReadKey(true).KeyChar.ToString().ToUpper())
                {
                case " ":
                    _viewModel.StartStop();
                    break;

                case "R":
                    _viewModel.Reset();
                    break;

                case "L":
                    _viewModel.LapTime();
                    break;

                default:
                    Console.CursorVisible = true;
                    Console.CursorLeft    = 0;
                    Console.CursorTop     = 5;
                    _quit = true;
                    break;
                }
            }
            WriteCurrentTime();
        }
예제 #2
0
 private void StartStopButton_Click(object sender, RoutedEventArgs e)
 {
     _stopwatchViewModel.StartStop();
 }
예제 #3
0
 private void StartStop(object sender, EventArgs e)
 {
     viewModel.StartStop();
 }