private bool?LoadingProcedure() { DialogResult dialogResult = openFileDialog1.ShowDialog(); if (dialogResult != DialogResult.OK) { if (dialogResult == DialogResult.Cancel) { return(null); } else { return(false); } } ProcessChain newChain = null; string path = openFileDialog1.FileName; string[] data = File.ReadAllLines(path); newChain = ProcessChain.FromText(data); if (newChain != null) { _processChain = newChain; FillFormWithProcessChain(_processChain); return(true); } else { MessageBox.Show(Resources.Loading_epc_Error); return(false); } }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } ProcessChain newChain = null; string path = openFileDialog1.FileName; string[] data = File.ReadAllLines(path); newChain = ProcessChain.FromText(data); if (newChain != null) { _processChain = newChain; FillFormWithProcessChain(_processChain); } else { MessageBox.Show(Resources.Loading_epc_Error); } }