コード例 #1
0
ファイル: Logix.cs プロジェクト: bludyh/logix
        private void ButtonVisualize_Click(object sender, EventArgs e)
        {
            try {
                int    index = 1;
                string str   = "graph logic { \r\nnode [ fontname = \"Sans serif\" ] " + proposition.CreateGraph(ref index) + "\r\n}";
                File.WriteAllText(@"visualization.dot", str);

                Process dot = new Process();
                dot.StartInfo.FileName  = @"dot.exe";
                dot.StartInfo.Arguments = "-Tpng -ovisualization.png visualization.dot";
                dot.Start();
                dot.WaitForExit();

                Process.Start(@"visualization.png");
            }
            catch (Exception ex) {
                MessageBox.Show(ex.ToString());
                ResetForm();
            }
        }