Ejemplo n.º 1
0
        private void EnableOrDisable()
        {
            if (EngineLoader.IsEngineEnabled())
            {
                EngineLoader.DisableEngine();
            }
            else
            {
                EngineLoader.EnableEngine();
            }

            RaisePropertyChanged(() => EngineState);
        }
Ejemplo n.º 2
0
        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);
        }