コード例 #1
0
        static void Main(string[] args)
        {
            var video = new Video()
            {
                Title = "Video1"
            };
            var videoEncoder   = new VideEncoder();    //publisher
            var mailService    = new MailService();    //subscriber
            var messageService = new MessageService(); //sub

            videoEncoder.videoEncoded += mailService.OnVideoEncoded;
            videoEncoder.videoEncoded += messageService.OnVideoEncoded;

            videoEncoder.Encode(video);
        }
コード例 #2
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!");
        }