static void Main(string[] args) { Timer tm = new Timer(5000); Listener1 ls1 = new Listener1(tm); Listener2 ls2 = new Listener2(tm); tm.SimulateCountdown(); ls1.Unregister(tm); tm.SimulateCountdown(); Console.ReadKey(true); }
public void Register(Timer tm) { tm.CountdownCompleted += Listener1Msg; }
public void Unregister(Timer tm) { tm.CountdownCompleted -= Listener1Msg; }
public Listener1(Timer tm) { tm.CountdownCompleted += Listener1Msg; }