Exemple #1
0
        /// <summary>
        /// Called when [count state changed].
        /// </summary>
        /// <param name="countDownState">State of the count down.</param>
        private void OnCountStateChanged(CountDownClockEvents.StateChangedArgs countDownState)
        {
            switch (countDownState)
            {
            case CountDownClockEvents.StateChangedArgs.Running: PlaySoundResource(CLOCK_START_WAV); break;

            case CountDownClockEvents.StateChangedArgs.Finished: PlaySoundResource(CLOCK_END_WAV); break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Called when [count down state changed].
        /// </summary>
        /// <param name="countDownState">State of the count down.</param>
        private void OnCountDownStateChanged(CountDownClockEvents.StateChangedArgs countDownState)
        {
            _clockState = countDownState;
            _startCommand.RaiseCanExecuteChanged();
            _pauseCommand.RaiseCanExecuteChanged();
            _resetCommand.RaiseCanExecuteChanged();

            if (countDownState == CountDownClockEvents.StateChangedArgs.Finished)
            {
                GameNextRound();
            }
        }
        /// <summary>
        /// Called when [count state changed].
        /// </summary>
        /// <param name="countDownState">State of the count down.</param>
        private void OnCountStateChanged(CountDownClockEvents.StateChangedArgs countDownState)
        {
            switch (countDownState)
            {
            case CountDownClockEvents.StateChangedArgs.Running:
                _countdownStartedTime = DateTime.Now;
                _clockRunning         = true;
                break;

            case CountDownClockEvents.StateChangedArgs.Reset:
            case CountDownClockEvents.StateChangedArgs.Paused:
                _clockRunning = false;
                break;

            case CountDownClockEvents.StateChangedArgs.Finished:
                _clockRunning = false;
                if (!_databaseWriter.IsBusy)
                {
                    _databaseWriter.RunWorkerAsync();
                }
                break;
            }
        }
        /// <summary>
        /// Called when [count down state changed].
        /// </summary>
        /// <param name="countDownState">State of the count down.</param>
        private void OnCountDownStateChanged(CountDownClockEvents.StateChangedArgs countDownState)
        {
            _clockState = countDownState;
            _startCommand.RaiseCanExecuteChanged();
            _pauseCommand.RaiseCanExecuteChanged();
            _resetCommand.RaiseCanExecuteChanged();

            if (countDownState == CountDownClockEvents.StateChangedArgs.Finished) GameNextRound();
        }