예제 #1
0
 private void BTNStart_Click(object sender, EventArgs e)
 {
     if (BTNStart.Text == "Start")
     {
         TimerSimulation.Start();
         BTNStart.Text = "Stop";
     }
     else
     {
         TimerSimulation.Stop();
         BTNStart.Text = "Start";
     }
 }
예제 #2
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            if (!play)
            {
                btnToggleLight.Enabled   = true;
                TimerSimulation.Interval = 1000;
                TimerSimulation.Start();

                Play();
                count = Simulation.TotalNumberCars;
                Simulation.StartTimers();
            }
            else if (play)
            {
                Stop();
            }
        }