From ec35cccc214fa84b6f4588c1afa5d9e73224019e Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Wed, 7 Sep 2022 18:44:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BC=98=E5=8C=96=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E5=B7=A5=E7=A8=8B=E6=97=B6=EF=BC=8C=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=B7=A6=E4=B8=8A=E8=A7=92=E6=98=BE=E7=A4=BA=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E5=90=8D=EF=BC=8C=E5=B7=A6=E4=B8=8B=E8=A7=92=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=A5=E7=A8=8B=E8=B7=AF=E5=BE=84=EF=BC=9B=202.=20?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E6=96=87=E4=BB=B6=E5=AD=98=E5=82=A8=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=AA=E6=95=B0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainProgram/Form1.cs | 7 ++----- mainProgram/ProjectManager.cs | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) 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