예제 #1
0
파일: Program.cs 프로젝트: schan1992/box
 static void Main(string[] args)
 {
     var encoder = new VideoEncoder();
     encoder.RegisterNotificationChannel(new MailNotificationChannel());
     encoder.RegisterNotificationChannel(new SmsNotificationChannel());
     encoder.Encode(new Video());
 }
예제 #2
0
        static void Main(string[] args)
        {
            var encoder = new VideoEncoder();

            encoder.RegisterNotificationChannel(new MailNotifiactionChannel());
            encoder.RegisterNotificationChannel(new SmsNotificationChannel());
            encoder.Encode(new Video());
        }
예제 #3
0
        static void Main(string[] args)
        {
            var encoder = new VideoEncoder();

            encoder.RegisterNotificationChannel(new MailNotificationChannel());
            encoder.RegisterNotificationChannel(new SmsNotificationChannel());
            Console.ReadLine();
        }
예제 #4
0
        static void Main(string[] args)
        {
            var videoEncoder = new VideoEncoder();

            videoEncoder.RegistorNotificationChannel(new MailNotificationChannel());
            videoEncoder.RegistorNotificationChannel(new SMSNotificationChannel());

            videoEncoder.Encode(new Video());
        }
예제 #5
0
        public void Encode(VideoEncoder video)
        {
            // Video logic
            // ...

            foreach (var channel in _notificationChannels)
            {
                channel.Send(new Message());
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            var videoEncoder = new VideoEncoder();

            videoEncoder.RegisterNotfication(new MailNotfication());
            videoEncoder.RegisterNotfication(new SmsNotfication());

            videoEncoder.Encode(new Video());
            System.Console.ReadLine();
        }
        static void Main(string[] args)
        {
            // initializing an encoder
            var encoder = new VideoEncoder();

            // After we initialize the encoder, we call that RegisterNotificationChannel()
            // and here we pass a concrete implementation of notification channel
            // MailNotificationChannel and SmsNotificationChannel
            // You can notice that with interfaces we also have a polymorphic behaviour

            encoder.RegisterNotificationChannel(new MailNotificationChannel());
            encoder.RegisterNotificationChannel(new SmsNotificationChannel());

            encoder.Encode(new Video());
        }