예제 #1
0
        static void Main(string[] args)
        {
            Document doc = new Document();
            doc.Text = "Document Text";

            var blogPoster = new BlogPoster();
            var blogDelegate = new Document.SendDoc(blogPoster.PostToBlog);
            doc.ReportSendingResult(blogDelegate);

            var emailSender = new EmailSender();
            var emailDelegate = new Document.SendDoc(emailSender.SendEmail);
            doc.ReportSendingResult(emailDelegate);

            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Document doc = new Document();

            doc.Text = "Document Text";

            var blogPoster   = new BlogPoster();
            var blogDelegate = new Document.SendDoc(blogPoster.PostToBlog);

            doc.ReportSendingResult(blogDelegate);

            var emailSender   = new EmailSender();
            var emailDelegate = new Document.SendDoc(emailSender.SendEmail);

            doc.ReportSendingResult(emailDelegate);

            Console.ReadLine();
        }