Exemple #1
0
 public void Handle(ExitApplicationCommand message)
 {
     if (!installWasAttempted)
     {
         eventAggregator.Publish <NoInstallAttemptedEvent>();
     }
     TryClose();
 }
Exemple #2
0
        public void window_command_exit_application_should_be_handle_by_command_bus()
        {
            var exitApplicationCommand = new ExitApplicationCommand(commandBus, null);

            exitApplicationCommand.Execute(null);

            exitCode.ShouldBe(0);
        }
Exemple #3
0
        public SplashScreenViewModel(
            ExitApplicationCommand exitApplicationCommand,
            StartApplicationCommand startApplicationCommand,
            IQueryBus queryBus, ILogger logger) : base(queryBus, logger)
        {
            this.exitApplicationCommand  = exitApplicationCommand;
            this.startApplicationCommand = startApplicationCommand;

            Initialize();
        }
        private void Minefield_GameEnded(object sender, Minefield.GameEndedEventArgs e)
        {
            MessageBoxResult result;

            if (e.IsWon)
            {
                result = dialogService.Show(Loc.MainWindow_Message_GameWon_Text, Loc.MainWindow_Message_GameWon_Title, MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
            }
            else
            {
                result = dialogService.Show(Loc.MainWindow_Message_GameLost_Text, Loc.MainWindow_Message_GameLost_Title, MessageBoxButton.YesNo, MessageBoxImage.Hand);
            }

            if (result == MessageBoxResult.No)
            {
                ExitApplicationCommand.Execute(null);
            }
            else if (result == MessageBoxResult.Yes)
            {
                RestartGameCommand.Execute(null);
            }
        }