public void subscribe(CountDownClock theClock) { theClock.TimesUp += (aClock, cd) => { Console.WriteLine("Notify: {0}", cd.ToString()); }; }
public void subscribe(CountDownClock theClock) { theClock.TimesUp += (aClock, cd) => { Console.WriteLine("Chef go get your toast."); }; }
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(); }