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