/// <summary>
        /// Model invoked this. The game ended.
        /// </summary>
        /// <param name="sender">The model. We do not use this.</param>
        /// <param name="e">The data of the ended game. We do not use it here. Controll will hadle it.</param>
        private void Model_SetGameEnded(object sender, ReversiSetGameEndedEventArgs e)
        {
            _passButtonEnabled = false;
            OnPropertyChanged("PassButtonEnabled");
            _pauseButtonEnabled = false;
            OnPropertyChanged("PauseButtonEnabled");

            _saved = true;
            _saveMenuItemEnabled = false;
            OnPropertyChanged("SaveMenuItemEnabled");
        }
 /// <summary>
 /// Invoked by the model, when the game ended.
 /// </summary>
 /// <param name="sender">The model. We do not use this.</param>
 /// <param name="e">The data that helps us to write out the result of the game.</param>
 private void Model_SetGameEnded(object sender, ReversiSetGameEndedEventArgs e)
 {
     if (e.Player1Points > e.Player2Points)
     {
         MessageBox.Show(_view, "Player 1 won." + Environment.NewLine + "Player 1 points: " + e.Player1Points.ToString() + ", player 2 points: " + e.Player2Points.ToString() + ".", "Game Ended", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else if (e.Player1Points < e.Player2Points)
     {
         MessageBox.Show(_view, "Player 2 won." + Environment.NewLine + "Player 1 points: " + e.Player1Points.ToString() + ", player 2 points: " + e.Player2Points.ToString() + ".", "Game Ended", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         MessageBox.Show(_view, "It is a tie." + Environment.NewLine + "Player 1 points: " + e.Player1Points.ToString() + ", player 2 points: " + e.Player2Points.ToString() + ".", "Game Ended", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
        private void model_SetGameEnded(Object sender, ReversiSetGameEndedEventArgs e)
        {
            _eventSetGameEndedInvoked = true;

            if (!_simpleEvents)
            {
                removeStep(e);
            }
        }
 /// <summary>
 /// Invoke the 'SetGameEnded' event handler if it is set.
 /// </summary>
 /// <param name="arg">The event hadler argumentum.</param>
 private void OnSetGameEnded(ReversiSetGameEndedEventArgs arg)
 {
     if (SetGameEnded != null)
     {
         SetGameEnded(this, arg);
     }
 }
        /// <summary>
        /// We finished a game. We delete the last put downs backwords, then if it not ended
        /// (_remainingSteps[0,0] != 0) we set _remainingSteps[0,0] to 1.
        /// </summary>
        /// <param name="e"></param>
        private void removeStep(ReversiSetGameEndedEventArgs e)
        {
            if (e.Player1Points > e.Player2Points)
            {
                _possibleResults[0] += 1;
            }
            else if (e.Player1Points < e.Player2Points)
            {
                _possibleResults[1] += 1;
            }
            else
            {
                _possibleResults[2] += 1;
            }

            while (_remainingSteps[_remainingSteps[0, 0], 0] == 0)
            {
                --(_remainingSteps[0, 0]);
                if (_remainingSteps[_remainingSteps[0, 0], 0] != 0)
                { 
                    _remainingSteps[_remainingSteps[0, 0], 0] -= 2;
                }

                if (_remainingSteps[0,0] == 0)
                {
                    break;
                }
            }

            if (_remainingSteps[0, 0] != 0)
            {
                _remainingSteps[0, 0] = 1;
                _currentPassingCount = 0;
            }

            ++_possibleGameCount;
        }