static void Main(string[] args)
 {
     Timer timer = new Timer();
     var Ringer = new Ringer();
     var student = new Student();
     student.Register(timer);
      Ringer.Register(timer);
     timer.StartTicking(5);
     Thread.Sleep(1000);
     Ringer.Unregister(timer);
     timer.StartTicking(3);
     Console.Read();
 }
Exemple #2
0
        static void Main(string[] args)
        {
            Timer timer   = new Timer();
            var   Ringer  = new Ringer();
            var   student = new Student();

            student.Register(timer);
            Ringer.Register(timer);
            timer.StartTicking(5);
            Thread.Sleep(1000);
            Ringer.Unregister(timer);
            timer.StartTicking(3);
            Console.Read();
        }