Esempio n. 1
0
        static void Main(string[] args)
        {
            Publisher publisher = new Publisher();

            SendViaMobile send2Mobile = new SendViaMobile("647 1234567");
            SendViaEmail send2Email = new SendViaEmail("*****@*****.**");

            send2Mobile.Subscribe(publisher);
            send2Email.Subscribe(publisher);

            publisher.PublishMessage("Hello!!! You have new notifications");
            Console.ReadKey();


        }
 public void Subscribe(Publisher pub)
 {
     pub.publishmsg += sendEmail;
 }
 public void Subscribe(Publisher pub)
 {
     pub.publishmsg += sendText;
 }