Exemplo n.º 1
0
        public bool SaveCurrentProject(string projectIPLName)
        {
            this.project = ProjectSingleton.CurrentProject;
            if ((this.project.ProjectIPLFile != projectIPLName) && this.ProjectIsOpened(projectIPLName))
            {
                this.LastErrMsg = "Project file \"" + projectIPLName + "\" has been opened!";
                return(false);
            }
            ProjectLogicMgr.Instance.GatherSerializeData(this.project as GeneralProjectEntity);
            GC.Collect();
            this.m_OldLossPath = this.GetProjectLossPath();
            ProjectInfo projectInfo = new ProjectInfo
            {
                projectName     = Path.GetFileName(projectIPLName),
                projectDocument = projectIPLName,
                projectLossPath = this.GetLossPath(projectIPLName)
            };

            this.m_SavingForm = new AutoCloseLoadingForm(this.m_OldLossPath, projectInfo.projectLossPath);
            if (!this.SaveToFile(projectInfo))
            {
                return(false);
            }
            this.project.Name           = projectInfo.projectName;
            this.project.ProjectIPLFile = projectInfo.projectDocument;
            this.LockProjectFile(projectInfo);
            ProjectSingleton.CurrentProject.NeedPromptSave = false;
            return(true);
        }
Exemplo n.º 2
0
 public bool SaveCurrentProject(string projectIPLName)
 {
     this.project = ProjectSingleton.CurrentProject;
     if ((this.project.ProjectIPLFile != projectIPLName) && this.ProjectIsOpened(projectIPLName))
     {
         this.LastErrMsg = "Project file \"" + projectIPLName + "\" has been opened!";
         return false;
     }
     ProjectLogicMgr.Instance.GatherSerializeData(this.project as GeneralProjectEntity);
     GC.Collect();
     this.m_OldLossPath = this.GetProjectLossPath();
     ProjectInfo projectInfo = new ProjectInfo();
     projectInfo.projectName = Path.GetFileName(projectIPLName);
     projectInfo.projectDocument = projectIPLName;
     projectInfo.projectLossPath = this.GetLossPath(projectIPLName);
     this.m_SavingForm = new AutoCloseLoadingForm(this.m_OldLossPath, projectInfo.projectLossPath);
     if (!this.SaveToFile(projectInfo))
     {
         return false;
     }
     this.project.Name = projectInfo.projectName;
     this.project.ProjectIPLFile = projectInfo.projectDocument;
     this.LockProjectFile(projectInfo);
     ProjectSingleton.CurrentProject.NeedPromptSave = false;
     return true;
 }