private bool CheckMeshBeforeSave() { if (currentMeshFileName == "") { MessageBox.Show("当前工程文件没有网格", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorLine("当前工程文件没有网格"); return(false); } if (!FoamMeshVerifier.VerifyVxtPath(currentMeshFileName)) { MessageBox.Show("网格路径非法", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorLine("网格路径非法"); return(false); } return(true); }
private void OnOpenMesh(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == DialogResult.OK) { if (!FoamMeshVerifier.VerifyDirectory(fbd.SelectedPath)) { MessageBox.Show("网格验证失败,路径:\n" + fbd.SelectedPath, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorLine("网格验证失败,路径: " + fbd.SelectedPath); return; } else { CaseModified = true; currentMeshFileName = FoamConst.GetVxtFilePath(fbd.SelectedPath); File.Create(currentMeshFileName); FillBoundaryTreeNode(); InitCaseBoundary(); foamViewer_main.SetMeshFileName(currentMeshFileName); } } }