public static void Main(string[] args) { ResultPublishEvent e = new ResultPublishEvent(); //Handlers EmailEventHandler email = new EmailEventHandler(); e.PublishResult += email.SendEmail; e.PublishResultNow(); Console.ReadLine(); }
public static void Main(string[] args) { ResultPublishEvent e = new ResultPublishEvent(); //Handlers EmailEventHandler email = new EmailEventHandler(); SmsEventHandler sms = new SmsEventHandler(); PostEventHandler post = new PostEventHandler(); e.PublishResult += email.SendEmail; e.PublishResult += sms.SmsSender; e.PublishResult += post.SendLetter; e.PublishResultNow(); Console.ReadLine(); }