Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_gaussian_Click(object sender, EventArgs e)
        {
            // create new dice object - pass seed to constructor
            aGaussian gaussian;
            string    str = textBox_seed.Text;
            int       parse_test, seed;

            if (int.TryParse(str, out parse_test))
            {
                seed     = int.Parse(str);
                gaussian = new aGaussian(seed);
                objects.Add(gaussian);
                listBox_objects.Items.Add("Gaussian");
            }
            else if (String.IsNullOrEmpty(str))
            {
                gaussian = new aGaussian();
                objects.Add(gaussian);
                listBox_objects.Items.Add("Gaussian");
            }
            else
            {
                MessageBox.Show("Invalid seed.  Enter an Integer or nothing at all.");
                textBox_seed.Text = "";
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button_gaussian_Click(object sender, EventArgs e)
 {
     // create new dice object - pass seed to constructor
     aGaussian gaussian;
     string str = textBox_seed.Text;
     int parse_test, seed;
     if (int.TryParse(str, out parse_test))
     {
         seed = int.Parse(str);
         gaussian = new aGaussian(seed);
         objects.Add(gaussian);
         listBox_objects.Items.Add("Gaussian");
     }
     else if (String.IsNullOrEmpty(str))
     {
         gaussian = new aGaussian();
         objects.Add(gaussian);
         listBox_objects.Items.Add("Gaussian");
     }
     else
     {
         MessageBox.Show("Invalid seed.  Enter an Integer or nothing at all.");
         textBox_seed.Text = "";
     }
 }