Example #1
0
        static void Main(string[] args)
        {
            var video = new Video() { Title = "My Video" };
            VideoEncoder myEncoder = new VideoEncoder(); // Publisher

            var mailService = new MailService(); // Subscriber
            myEncoder.videoEncoded += mailService.OnVideoEncode;

            var messageService = new MessageService(); // Subscriber
            myEncoder.videoEncoded += messageService.OnVideoEncode;

            myEncoder.Encode(video);

            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            var video = new Video()
            {
                Title = "My Video"
            };
            VideoEncoder myEncoder = new VideoEncoder(); // Publisher

            var mailService = new MailService();         // Subscriber

            myEncoder.videoEncoded += mailService.OnVideoEncode;

            var messageService = new MessageService(); // Subscriber

            myEncoder.videoEncoded += messageService.OnVideoEncode;

            myEncoder.Encode(video);

            Console.ReadLine();
        }