private void Open_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { if (sender == OpenA) { DrawA = FileGraph.OpenGraph(openFileDialog.FileName); DrawA.DrawEdgeValue = EdgeParam.Checked; UpdatePicter(OutputA); } else { DrawB = FileGraph.OpenGraph(openFileDialog.FileName); DrawB.DrawEdgeValue = EdgeParam.Checked; UpdatePicter(OutputB); } } catch (Exception) { MessageBox.Show("error"); } } }
private void OpenToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { try { FileGraph file = new FileGraph(openFileDialog.FileName); draw.graph = file.OpenGraph(); was.Clear(); foreach (var item in draw.graph.Nodes) { was.Add(item.Value); } UPDImage(); } catch (Exception) { MessageBox.Show("Error"); } } }