Exemplo n.º 1
0
 static void Main(string[] args)
 {
     var encoder = new VideoEncoder();
     encoder.RegisterNotificationChannel(new MailNotificationChannel());
     encoder.RegisterNotificationChannel(new SmsNotificationChannel());
     encoder.Encode(new Video());
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var encoder = new VideoEncoder();

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

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

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

            videoEncoder.Encode(new Video());
        }
Exemplo n.º 5
0
        public void Encode(VideoEncoder video)
        {
            // Video logic
            // ...

            foreach (var channel in _notificationChannels)
            {
                channel.Send(new Message());
            }
        }
Exemplo n.º 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());
        }