|
@@ -543,7 +543,7 @@ namespace OTSModelSharp
|
|
String strPathName = "";
|
|
String strPathName = "";
|
|
// file open dialog
|
|
// file open dialog
|
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
|
- saveFileDialog.FileName = m_strPathName.Split('\\')[m_strPathName.Split('\\').Length-1];
|
|
|
|
|
|
+ saveFileDialog.FileName = m_strPathName.Split('\\')[m_strPathName.Split('\\').Length - 1];
|
|
saveFileDialog.Filter = "Probject Files (*.prj)|*.prj|All files (*.*)|*.*";
|
|
saveFileDialog.Filter = "Probject Files (*.prj)|*.prj|All files (*.*)|*.*";
|
|
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
|
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
|
{
|
|
{
|
|
@@ -552,7 +552,14 @@ namespace OTSModelSharp
|
|
}
|
|
}
|
|
// get file pathname
|
|
// get file pathname
|
|
strPathName = saveFileDialog.FileName;
|
|
strPathName = saveFileDialog.FileName;
|
|
-
|
|
|
|
|
|
+ string DirectoryName = Path.GetDirectoryName(strPathName);
|
|
|
|
+ DirectoryInfo Folder = new DirectoryInfo(DirectoryName);
|
|
|
|
+ List<string> FolderNames = new List<string>();
|
|
|
|
+ if (Folder.GetDirectories().Length != 0)
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("Save failed, a folder exists in the current location, delete or create a new one!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
//保存测量项目文件 .prj
|
|
//保存测量项目文件 .prj
|
|
XmlDocument doc = new XmlDocument();
|
|
XmlDocument doc = new XmlDocument();
|
|
//添加xml文件头申明
|
|
//添加xml文件头申明
|