protected MainWindowViewModel(IUIServices uiServices) { _uiServices = uiServices; _editorHostLoader = new EditorHostLoader(); _editorHost = _editorHostLoader.EditorHost; _classificationFormatMapService = _editorHostLoader.CompositionContainer.GetExportedValue <IClassificationFormatMapService>(); InitializeViewModelState(); EnableDisableTddStud10Command = new RelayCommand( EnableOrDisable, () => { return(!string.IsNullOrWhiteSpace(SolutionPath)); }); CancelRunCommand = new RelayCommand( () => { EngineLoader.EnableEngine(); RaisePropertyChanged(() => IsRunInProgress); }); OpenFileCommand = new RelayCommand(ExecuteOpenFileCommand); OpenSolutionCommand = new RelayCommand(ExecuteOpenSolutionCommand); SaveAllCommand = new RelayCommand(ExecuteSaveAllCommand); }
public void OnRunEnded(RunStartParams rsp) { DispatcherHelper.CheckBeginInvokeOnUI( () => { AddTextToConsole(sb => sb.AppendFormat("### Ended run.")); EngineLoader.EnableEngine(); }); }
private void EnableOrDisable() { if (EngineLoader.IsEngineEnabled()) { EngineLoader.DisableEngine(); } else { EngineLoader.EnableEngine(); } RaisePropertyChanged(() => EngineState); }
private void ExecuteOpenSolutionCommand() { if (SolutionPath != null) { if (EngineLoader.IsRunInProgress()) { _uiServices.ShowMessageBox("Cannot close solution as a run is in progress"); return; } EngineLoader.DisableEngine(); EngineLoader.Unload(); InitializeViewModelState(); } var slnPath = _uiServices.OpenFile("Solution Files|*.sln"); if (slnPath == null) { return; } SolutionPath = slnPath; var cfg = EngineConfigLoader.load(new EngineConfig(), FilePath.NewFilePath(slnPath)); EngineLoader.Load( null, new EngineParams( HostVersion, cfg, FilePath.NewFilePath(slnPath), DateTime.UtcNow)); EngineLoader.EnableEngine(); RaisePropertyChanged(() => EngineState); CommandManager.InvalidateRequerySuggested(); OpenFile(slnPath); }