/// <inheritdoc/> protected override void ExecuteInternal(object parameter) { if (parameter is string projectName) { projectName += projectName.EndsWith(ProjectFileService.ProjectFileExtension) ? string.Empty : ProjectFileService.ProjectFileExtension; var projectPath = Path.Combine(ProjectFileService.TemplatesSaveDirectoryPath, projectName).Replace(@"\\", @"\"); var project = _projectFileService.LoadProject(projectPath); if (project is object) { ProjectLoaded(project); } } else { _projectFileService.LoadProject(ProjectLoaded); } }
internal override void ExecuteInternal(IShell shell, object parameter) { ProjectModel project; if (parameter is string projectName) { projectName += projectName.EndsWith(ProjectFileService.ProjectFileExtension) ? string.Empty : ProjectFileService.ProjectFileExtension; var projectPath = Path.Combine(_projectFileService.ProjectDirectory, projectName).Replace(@"\\", @"\"); project = _projectFileService.LoadProject(projectPath); } else { project = _projectFileService.LoadProject(); } if (project != null) { LoadProject(shell, project); } }
/// <inheritdoc/> protected override void ExecuteInternal(object parameter) { var projectName = _projectManager.Project.Name; _projectFileService.SaveProject(_projectManager.Project, saveAs: false, () => { _projectManager.Project = null; _projectManager.CloseProject(() => { projectName += projectName.EndsWith(ProjectFileService.ProjectFileExtension) ? string.Empty : ProjectFileService.ProjectFileExtension; var projectPath = Path.Combine(ProjectFileService.ProjectsSaveDirectoryPath, projectName).Replace(@"\\", @"\"); var project = _projectFileService.LoadProject(projectPath); _projectManager.SetProject(project, true); }); }); }