示例#1
0
        public void Run()
        {
            CountDownClock toasterCountDown = new CountDownClock("Toasts are ready to serve", 30);

            Toaster     toaster = new Toaster();
            ToasterChef chef    = new ToasterChef();

            toaster.subscribe(toasterCountDown);
            chef.subscribe(toasterCountDown);

            toasterCountDown.Run();
        }
示例#2
0
 public void subscribe(CountDownClock theClock)
 {
     theClock.TimesUp += new CountDownClock.CountDownHandler(toasterTimesUp);
 }