예제 #1
0
        public void FaxMsg(object sender, NewMailEventArgs e)
        {
            MailManager tmep = sender as MailManager;
            int         x    = tmep.test;

            Console.WriteLine($"In Pager: from:{e.From}, to:{e.To}, subject:{e.Subject}");
        }
예제 #2
0
        static void Main(string[] args)
        {
            MailManager mailManager = new MailManager();
            Fax         fax         = new Fax(mailManager);
            Pager       pager       = new Pager(mailManager);

            mailManager.ReceiveEmail("boone", "james", "吃饭了吗?");
            Console.ReadLine();
        }
예제 #3
0
 public Fax(MailManager mailManager)
 {
     this.mailManager           = mailManager;
     this.mailManager.NewEmail += FaxMsg;
 }