| | |
| | | using System.Text; |
| | | using System.Windows.Forms; |
| | | using static Hydro.MapView.MapViewEnum; |
| | | using Cursor = System.Windows.Forms.Cursor; |
| | | |
| | | |
| | | namespace Hydro.WinfrmUI |
| | | { |
| | |
| | | |
| | | |
| | | #region 文件工具 |
| | | public void OpenFile(string filePath) |
| | | { |
| | | _Template = new Template(); |
| | | _Template.network = new MapViewNetWork(); |
| | | |
| | | |
| | | |
| | | |
| | | // 读取文件内容 |
| | | _Network.BuildFromInp(filePath); |
| | | _Template.filePath = filePath; |
| | | //_filePath = filePath; |
| | | SetData(_Template); |
| | | |
| | | } |
| | | |
| | | private void tool打开_ButtonClick(object sender, EventArgs e) |
| | | { |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | public void OpenFile(string filePath) |
| | | { |
| | | _Template = new Template(); |
| | | _Template.network = new MapViewNetWork(); |
| | | |
| | | //private void 旧版打开ToolStripMenuItem_Click(object sender, EventArgs e) |
| | | //{ |
| | | // // 创建打开文件对话框 |
| | | |
| | | |
| | | |
| | | { |
| | | // 读取文件内容 |
| | | _Network.BuildFromInp(filePath); |
| | | _Template.filePath = filePath; |
| | | //_filePath = filePath; |
| | | SetData(_Template); |
| | | } |
| | | } |
| | | private void 旧版打开ToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | // 创建打开文件对话框 |
| | | OpenFileDialog openFileDialog = new OpenFileDialog(); |
| | | openFileDialog.Filter = "INP Files (*.inp)|*.inp|All Files (*.*)|*.*"; |
| | | |
| | | if (openFileDialog.ShowDialog() == DialogResult.OK) |
| | | { |
| | | _Template = new Template(); |
| | | _Template.network = new MapViewNetWork(); |
| | | //_Template.network.use_old = true; |
| | | // 获取选中文件的文件路径 |
| | | string filePath = openFileDialog.FileName; |
| | | { |
| | | // 读取文件内容 |
| | | _Network.BuildFromInp(filePath); |
| | | _Template.filePath = filePath; |
| | | //_filePath = filePath; |
| | | SetData(_Template); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void 打开文件位置ToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | if (_filePath == null) return; |
| | | FileInfo fi = new FileInfo(_filePath); |
| | | Process.Start("explorer.exe", $"/select,\"{_filePath}\""); |
| | | //System.Diagnostics.Process.Start("explorer.exe", fi.Directory.FullName); |
| | | } |
| | | private void EPA中打开ToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | if (_filePath == null) return; |
| | | |
| | | |
| | | Process.Start(@"epanetH\Epanet2wH.exe", _filePath); |
| | | } |
| | | // _Template = new Template(); |
| | | // _Template.network = new MapViewNetWork(); |
| | | // //_Template.network.use_old = true; |
| | | // // 获取选中文件的文件路径 |
| | | // string filePath = openFileDialog.FileName; |
| | | // { |
| | | // // 读取文件内容 |
| | | // _Network.BuildFromInp(filePath); |
| | | // _Template.filePath = filePath; |
| | | // //_filePath = filePath; |
| | | // SetData(_Template); |
| | | // } |
| | | |
| | | //} |
| | | |
| | | private void 保存ToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | if (!_IsEditMode) |
| | |
| | | //form_EditFloors.Show(this); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |