Ejemplo n.º 1
0
        private void btnBinaryTree_Click(object sender, EventArgs e)
        {
            string v = tbxFormula.Text;

            if (rbtnPrefix.Checked)
            {
                if (v != "")
                {
                    tree = tree.Create(v);
                    tree.DrawBinaryTree();
                    dot.StartInfo.FileName  = "dot.exe";
                    dot.StartInfo.Arguments = "dot -Tpng -oabc.png abc.dot";
                    dot.Start();
                    dot.WaitForExit();
                    pictureBox1.ImageLocation = "abc.png";
                    tabControl1.SelectedIndex = 1;
                }
                else
                {
                    MessageBox.Show("Please, write a valid formula!");
                }
            }
            else
            {
                MessageBox.Show("Please, select the radio button!");
            }
        }
Ejemplo n.º 2
0
        private void btnMcLaurinTree_Click(object sender, EventArgs e)
        {
            string v = tbxFormula.Text;

            if (rbtnPrefix.Checked)
            {
                if (v != "")
                {
                    treeLaurAn       = treeLaurAn.CreateMcLaurinAn(v, (int)nudSeriesNumber.Value);
                    lblFunction.Text = treeLaurAn.Read();
                    treeLaurAn.DrawBinaryTree();
                    dot.StartInfo.FileName  = "dot.exe";
                    dot.StartInfo.Arguments = "dot -Tpng -oabc.png abc.dot";
                    dot.Start();
                    dot.WaitForExit();
                    pictureBox1.ImageLocation = "abc.png";
                    tabControl1.SelectedIndex = 1;
                }
                else
                {
                    MessageBox.Show("Please, write a valid formula!");
                }
            }
            else
            {
                MessageBox.Show("Please, select the radio button!");
            }
        }