修复bug:创建工程时会删除工程路径下的内容,修复后不会删除内容;
This commit is contained in:
@ -34,6 +34,15 @@ namespace mainProgram
|
|||||||
string projectPath = ProjectPathTextBox.Text;
|
string projectPath = ProjectPathTextBox.Text;
|
||||||
string calFilePath = CalFilePathTextBox.Text;
|
string calFilePath = CalFilePathTextBox.Text;
|
||||||
|
|
||||||
|
//当创建工程时,工程文件夹必须为空
|
||||||
|
DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(projectPath));
|
||||||
|
FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();
|
||||||
|
if (fileinfo.Length != 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, "工程文件夹中有内容", "提示");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dataPath != null && dataPath.Length == 0)
|
if (dataPath != null && dataPath.Length == 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show(this, "数据文件夹路径不能为空", "提示");
|
MessageBox.Show(this, "数据文件夹路径不能为空", "提示");
|
||||||
@ -50,13 +59,6 @@ namespace mainProgram
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//做判断:
|
|
||||||
DialogResult re = MessageBox.Show("删除工程路径下所有内容?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
|
|
||||||
if (re == DialogResult.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//创建工程
|
//创建工程
|
||||||
ProjectManager projectManager = new ProjectManager(projectPath);
|
ProjectManager projectManager = new ProjectManager(projectPath);
|
||||||
int value = projectManager.CreateProject(calFilePath, dataPath);
|
int value = projectManager.CreateProject(calFilePath, dataPath);
|
||||||
|
@ -253,7 +253,7 @@ namespace mainProgram
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
DelectDir(mProjectPath);//删除工程路径下的所有内容
|
//DelectDir(mProjectPath);//删除工程路径下的所有内容 → 应该删除此行代码,删除数据太危险
|
||||||
|
|
||||||
CreateProjectStructure();
|
CreateProjectStructure();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user