private void SaveToolStripMenuItem_Click(object sender, EventArgs e) { if (saveFileDialog.ShowDialog() == DialogResult.OK) { try { FileGraph file = new FileGraph(saveFileDialog.FileName); file.SaveGraph(draw.graph); } catch (Exception) { MessageBox.Show("Error"); } } }
private void Save_Click(object sender, EventArgs e) { if (saveFileDialog.ShowDialog() == DialogResult.OK) { try { if (sender == SaveA) { FileGraph.SaveGraph(DrawA, saveFileDialog.FileName); } else { FileGraph.SaveGraph(DrawB, saveFileDialog.FileName); } } catch (Exception) { MessageBox.Show("error"); } } }