Example #1
0
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     btnGenerate.Enabled = false;
     try
     {
         double lenght = Decimal.ToDouble(parcourLength.Value);
         double channel = Decimal.ToDouble(channelWide.Value);
         int count = Decimal.ToInt32(corridorCount.Value);
         t = new Timer();
         t.Tick += new EventHandler(t_Tick);
         t.Interval = 100;
         t.Start();
         pc = new ParcourGenerator();
         pc.GenerateParcour(activeParcour, c, lenght, channel, count);
         PictureBox1.Invalidate();
     }
     catch (Exception ex)
     {
         btnGenerate.Enabled = true;
         MessageBox.Show(ex.Message, "Error while generating Parcour");
     }
 }