Example #1
0
 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);
 }
Example #2
0
 public void Register(Timer tm)
 {
     tm.CountdownCompleted += Listener1Msg;
 }
Example #3
0
 public void Unregister(Timer tm)
 {
     tm.CountdownCompleted -= Listener1Msg;
 }
Example #4
0
 public Listener1(Timer tm)
 {
     tm.CountdownCompleted += Listener1Msg;
 }