private void Show(ShowSettingsEvent @event)
 {
    _settings = @event.Settings;
    var fixieSettings = _settings.Fixie;
    Fixie.Value = new FixieViewModel
                  {
                     Args = fixieSettings.Args
                  };
    var msBuildSettings = _settings.MsBuild;
    MsBuild.Value = new MsBuildViewModel
                    {
                       Args = msBuildSettings.Args,
                       Configuration = msBuildSettings.Configuration,
                       Configurations = @event.Configurations,
                       Platform = msBuildSettings.Platform,
                       Platforms = @event.Platforms,
                       Verbosity = msBuildSettings.Verbosity
                    };
    Projects.Value = _settings.Projects.Select(x => new ProjectViewModel
                                                          {
                                                             IsTestProject = x.IsTestProject,
                                                             Path = x.Path
                                                          });
    Visible.Value = true;
 }
 private void ConfigureExisting(SolutionSettings.HistoryItem item)
 {
    _eventBus.Publish(new OpenSolutionEvent
                 {
                    Id = item.Id,
                    ShowSettings = true
                 });
 }
      private void OpenNewSolution(OpenNewSolutionEvent @event)
      {
         Path.Value = @event.Path;
         _eventBus.Publish(new ShowContentEvent { ViewModel = this });
         _solution = Solution.Load(@event.Path);
         _settings = new SolutionSettings
                     {
                        MsBuild =
                        {
                           Configuration = _solution.Configurations.First(),
                           Platform = _solution.Platforms.First()
                        },
                        Path = @event.Path,
                        Projects = _solution.Select(x => new ProjectSettings
                                                         {
                                                            IsTestProject = x.IsTestProject(),
                                                            Path = x.Path
                                                         })
                                            .ToList()
                     };
         _solution.Changed += delegate { HasChanges.Value = true; };
         _onSettingsClosed = settingsAccepted =>
                             {
                                if (settingsAccepted)
                                {
                                   IsEnabled.Value = true;
                                   HasChanges.Value = true;
                                }
                                else
                                {
                                   Exit();
                                }
                             };

         _eventBus.Publish(new ShowSettingsEvent
                           {
                              Configurations = _solution.Configurations,
                              Platforms = _solution.Platforms,
                              Settings = _settings
                           });
      }
      private void OpenSolution(OpenSolutionEvent @event)
      {
         _eventBus.Publish(new ShowContentEvent { ViewModel = this });
         _settings = SolutionSettings.Load(@event.Id);
         Path.Value = _settings.Path;
         _solution = Solution.Load(_settings.Path);
         // TODO handle projects added/removed
         _solution.Changed += delegate { HasChanges.Value = true; };

         _onSettingsClosed = settingsAccepted =>
                             {
                                if (!settingsAccepted) return;
                                HasChanges.Value = true;
                                IsEnabled.Value = true;
                             };

         if (@event.ShowSettings)
         {
            ShowSettings();
         }
         else
         {
            HasChanges.Value = true;
            IsEnabled.Value = true;
         }
      }
 private void RunExisting(SolutionSettings.HistoryItem item)
 {
    _eventBus.Publish(new OpenSolutionEvent
                 {
                    Id = item.Id,
                    ShowSettings = false
                 });
 }