コード例 #1
0
ファイル: GraphForm.cs プロジェクト: sid0adams/Graph
 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");
         }
     }
 }
コード例 #2
0
 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");
         }
     }
 }