Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            TimerManager timer = new TimerManager();
            AlarmClock alarmClock = new AlarmClock(timer);
            Finisher finisher = new Finisher(timer);

            timer.Start(5000);

            alarmClock.Unregister(timer);

            timer.Start(2000);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            TimerManager time = new TimerManager();
            AlarmClock alarm = new AlarmClock();
            Siren siren = new Siren();
            
            alarm.Register(time);
            time.Countdown(7);
            time.Countdown(7);
            alarm.UnRegister(time);
            time.Countdown(7);
            siren.Register(time);
            time.Countdown(4);
            siren.UnRegister(time);

            Console.ReadKey();
        }