Beispiel #1
0
        static void Main(string[] args)
        {
            var video = new Video()
            {
                title = "Video 1"
            };
            var            videoencoder = new VideoEncoder();
            MailService    ms           = new MailService();
            MessageService mt           = new MessageService();

            videoencoder.videoEncoded += ms.OnVideoEncoded;
            videoencoder.videoEncoded += mt.OnVideoEncoded;
            videoencoder.Encode(video);

            Console.WriteLine("Hello World!");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //Person newPerson1 = new Person() { FirstName = "Paul", LastName = "McDuck" };
            Video newVideo = new Video()
            {
                Name = "DirHard.mp4"
            };
            VideoEncoder videoEncoder = new VideoEncoder();                      //Publisher

            NotificationService notificationService = new NotificationService(); //Subscriber
            EmailService        emailService        = new EmailService();

            videoEncoder.VideoEncoded += notificationService.OnVideoEncoded;
            videoEncoder.VideoEncoded += emailService.OnVideoEncoded;

            videoEncoder.Encode(newVideo);


            Console.WriteLine("-----");
            Console.WriteLine(newVideo.Name + ", " + newVideo.EmailState + ", " + newVideo.TextState);
            Console.ReadKey();
        }