diff --git a/mainProgram/Form1.cs b/mainProgram/Form1.cs index 1ca8a7b..57f6026 100644 --- a/mainProgram/Form1.cs +++ b/mainProgram/Form1.cs @@ -84,16 +84,13 @@ namespace mainProgram private void SetProjectNameAndProjectPath() { - this.Text = this.Text + "-" + getProjectName(); + this.Text = this.Text + "-" + mProjectManager.ProjectName; this.projectPath_toolStripStatusLabel.Text = this.projectPath_toolStripStatusLabel.Text + mProjectManager.ProjectPath; } private void ClearProjectNameAndProjectPath() { - this.Text = this.Text + "-" + getProjectName(); - this.projectPath_toolStripStatusLabel.Text = this.projectPath_toolStripStatusLabel.Text + mProjectManager.ProjectPath; - - int index = this.Text.IndexOf(getProjectName()); + int index = this.Text.IndexOf(mProjectManager.ProjectName); this.Text = this.Text.Substring(0, index - 1);//index - 1:还要加上一个字符“-” int index2 = this.projectPath_toolStripStatusLabel.Text.IndexOf(mProjectManager.ProjectPath); diff --git a/mainProgram/ProjectManager.cs b/mainProgram/ProjectManager.cs index d2f9389..f08fce5 100644 --- a/mainProgram/ProjectManager.cs +++ b/mainProgram/ProjectManager.cs @@ -169,14 +169,16 @@ namespace mainProgram public class ProjectManager { - public ProjectManager(string xx) + public ProjectManager(string projectFile) { - string sourceFileName = Path.GetFileName(xx);//获取文件名 - mProjectFile = xx; - mProjectPath = Path.GetDirectoryName(xx); + string sourceFileName = Path.GetFileName(projectFile);//获取文件名 + mProjectFile = projectFile; + mProjectPath = Path.GetDirectoryName(projectFile); + mProjectName = Path.GetFileNameWithoutExtension(projectFile); } private string mProjectFile; + private string mProjectName; private string mProjectPath; private string mMetadataPath; @@ -199,6 +201,18 @@ namespace mainProgram } } + public string ProjectName + { + get + { + return mProjectName; + } + set + { + mProjectName = value; + } + } + public string MetadataPath { get