Example #1
0
        static void Main(string[] args)
        {
            MailManager mm     = new MailManager();
            Fax         fax1   = new Fax(mm, "Austria");
            Fax         fax2   = new Fax(mm, "London");
            Fax         fax3   = new Fax(mm, "Varshava");
            Pager       pager1 = new Pager(mm, "John");
            Pager       pager2 = new Pager(mm, "Sophia");

            mm.SimulateNewMail("Artur", "Anna", "New Album");
            mm.SimulateNewMail("Gosleng", "Emo", "New Movie!");


            /*
             * PostManager pm = new PostManager();
             * PostService post1 = new PostService(pm);
             * PostService post2 = new PostService(pm);
             *
             * pm.SimulateNewPack("Andrew", "Lesley", "Clocks", "AmazonExpress");
             */

            Console.WriteLine("Enter for exit...");
            Console.ReadLine();
        }
Example #2
0
 public Fax(MailManager mm, string faxloc)
 {
     m_faxloc    = faxloc;
     mm.NewMail += FaxMsg; //подписались на событие
 }
Example #3
0
 public void Unregister(MailManager mm)
 {
     mm.NewMail -= FaxMsg;
 }
Example #4
0
 public Pager(MailManager mm, string owner)
 {
     m_owner     = owner;
     mm.NewMail += PagerMsg;
 }