示例#1
0
        public static void Main(string[] args)
        {
            var manager = new MailManager();
            var sms     = new Sms(manager);
            var pager   = new Pager(manager);

            manager.SimulateNewMail("Minsk", "Moskva", "Letter");

            Thread.Sleep(1000);

            sms.Unregister(manager);
            Console.WriteLine();
            manager.SimulateNewMail("Moskva", "Minsk", "SMS");

            Console.ReadKey();
        }
示例#2
0
 public void Unregister(MailManager mail)
 {
     mail.NewMail -= SmsMsg;
 }
示例#3
0
 public Sms(MailManager mail)
 {
     mail.NewMail += SmsMsg;
 }
示例#4
0
 public Pager(MailManager mail)
 {
     mail.NewMail += PagerMsg;
 }