Ejemplo n.º 1
0
Archivo: Form1.cs Proyecto: FtMan/ES
        void answer_button_click(object sender, EventArgs e)
        {
            Button bt = sender as Button;

            if (bt == null)
            {
                MessageBox.Show("Sender is not a RadioButton");
                return;
            }

            if (selectedrb != null)
            {
                int chosed_fact_ind = selectedrb.fact_number;
                int next_node_id    = current_node.get_edges()[chosed_fact_ind].node_id;

                current_node = nodes.Find(x => x.id == next_node_id);
                if (current_node.get_edges().Count == 0)
                {
                    current_node_is_answer = true;
                }

                update_work_space();
                selectedrb = null;
            }
        }
Ejemplo n.º 2
0
Archivo: Form1.cs Proyecto: FtMan/ES
        void radioButton_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton_fact rb = sender as RadioButton_fact;

            if (rb == null)
            {
                MessageBox.Show("Sender is not a RadioButton");
                return;
            }

            if (rb.Checked)
            {
                selectedrb = rb;
            }
        }
Ejemplo n.º 3
0
        void create_facts_for_work_space()
        {
            int counter = 0;

            foreach (Edge i in current_node.get_edges())
            {
                var  fct_id    = i.fact_id;
                Fact curr_fact = facts.Find(x => x.id == fct_id);

                RadioButton_fact rb = new RadioButton_fact(counter);
                rb.Text            = curr_fact.text + "\n";
                rb.CheckedChanged += new EventHandler(radioButton_CheckedChanged);

                counter++;
                fact_buttons.Add(rb);
            }
        }