예제 #1
0
 /// <inheritdoc/>
 protected override void ExecuteInternal(object parameter)
 {
     if (_projectManager.Project != null)
     {
         _projectFileService.SaveProject(_projectManager.Project, saveAs: false, () => { });
     }
 }
예제 #2
0
        public bool CloseProject()
        {
            if (IsProjectDirty)
            {
                var result = _projectFileService.ConfirmProjectClose();
                if (result == MessageBoxResult.Cancel)
                {
                    return(false);
                }

                if (result == MessageBoxResult.Yes)
                {
                    _projectFileService.SaveProject(CurrentProject, false);
                }
                else if (result == MessageBoxResult.No)
                {
                    CurrentProject.IsDirty = false;
                }
            }
            return(true);
        }
        /// <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);
                });
            });
        }