示例#1
0
        static void Main(string[] args)
        {
            Countdown countdown = new Countdown(10, "Hello, world!");

            CountdownDisplay countdownDisplay = new CountdownDisplay();
            countdownDisplay.Subscribe(countdown);

            countdown.Start();
        }
示例#2
0
 public void Subscribe(Countdown countdown)
 {
     countdown.CountdownComplete += PrintCountdownComplete;
 }