private void Start_Click(object sender, EventArgs e) { int minutes = (int)numericUpDown1.Value; int secundes = (int)numericUpDown2.Value; countdownTimer = new CountdownTimer(new TimeSpan(0,0, minutes, secundes, 0)); countdownTimer.Start(timer1); Text = "Start"; }
// Listener unregister itself so that it no longer receives notifications public void Unregister(CountdownTimer timer) { timer.CountdownEvent -= Listen; }
// Pass the CountdownTimer object to the constructor public Listener(CountdownTimer timer) { timer.CountdownEvent += Listen; }