Esempio n. 1
0
 private void cmdSayIt_Click(object sender, EventArgs e)
 {
     var valueToSay = 0;
     if(Int32.TryParse(txtNumber.Text,out valueToSay))
     {
         var sayIt = new SayIt();
         MessageBox.Show(sayIt.Convert(valueToSay));
     }
     else
     {
         MessageBox.Show("Not a number");
     }
 }
Esempio n. 2
0
        private void cmdSayIt_Click(object sender, EventArgs e)
        {
            var valueToSay = 0;

            if (Int32.TryParse(txtNumber.Text, out valueToSay))
            {
                var sayIt = new SayIt();
                MessageBox.Show(sayIt.Convert(valueToSay));
            }
            else
            {
                MessageBox.Show("Not a number");
            }
        }