コード例 #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 MailNotificationChannel());
            encoder.RegisterNotificationChannel(new SmsNotificationChannel());
            encoder.Encode(new Video());
        }
コード例 #3
0
        static void Main(string[] args)
        {
            var videoEncoder = new VideoEncoder();

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

            videoEncoder.Encode(new Video());
        }
コード例 #4
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();
        }
コード例 #5
0
        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());
        }