コード例 #1
0
        public static void Main(string[] args)
        {
            ResultPublishEvent e = new ResultPublishEvent();

            //Handlers
            EmailEventHandler email = new EmailEventHandler();

            e.PublishResult += email.SendEmail;

            e.PublishResultNow();

            Console.ReadLine();
        }
コード例 #2
0
        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();
        }