Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     scoreComputer = null;
     textBox1.Text = "8";
     textBox2.Text = "2";
 }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            correct = Convert.ToInt16(textBox1.Text);
            incorrect = Convert.ToInt16(textBox2.Text);

            if (rdo_Adult.Checked)
            {
                scoreComputer = new ScorerDelegate(Scorer.AdultScore);
            }
            if (rdo_Child.Checked)
            {
                scoreComputer = new ScorerDelegate(Scorer.ChildScore);
            }
            if (scoreComputer != null)
            {
                computeScore(scoreComputer);
            }
        }
Ejemplo n.º 3
0
 public void computeScore(ScorerDelegate scoreDelegate)
 {
     int score = scoreDelegate(correct, incorrect);
     textBox3.Text = Convert.ToString(score);
 }