private void ShowForm(Example pExample)
        {
            if (panel1.Controls.Count > 0)
            {
                panel1.Controls[0].Parent = null;
            }

            IExampleForm lSource = SubForms[pExample];

            lSource.GetMainPanel().Parent = panel1;
            lSource.GetMainPanel().Dock   = DockStyle.Fill;
            textBoxDescription.Text = lSource.GetDescription();
        }
Exemplo n.º 2
0
        private void RunTransitionSystem(string exampleName)
        {
            if (CheckInput())
            {
                //this.Cursor = Cursors.WaitCursor;
                DateTime     startSetup = DateTime.Now;
                IExampleForm example    = null;
                switch (exampleName)
                {
                case "towers":
                    example = new TowersOfHanoi(int.Parse(textBox1.Text));
                    break;

                case "milners":
                    example = new MilnersScheduler(int.Parse(textBox1.Text));
                    break;

                case "cannibal":
                    example = new CannibalsAndMissionaries();
                    break;

                case "knight":
                    example = new Knight(int.Parse(textBox1.Text));
                    break;

                case "knightEasy":
                    example = new KnightEasy(int.Parse(textBox1.Text));
                    break;

                case "queen":
                    example = new QueenProblem(int.Parse(textBox1.Text));
                    break;

                case "fdd":
                    example = new FDDStatemachine();
                    break;

                case "sudoku":
                    example = new Sudoku();
                    break;
                }
                string   solutions   = example.Run(checkBox1.Checked, checkBox2.Checked, checkBox3.Checked);
                DateTime finishSetup = DateTime.Now;
                TimeSpan duration    = finishSetup - startSetup;
                box = "Duration: " + duration + Environment.NewLine + solutions;
                //this.Cursor = Cursors.Arrow;
            }
        }