static void Main(string[] args) { var encoder = new VideoEncoder(); encoder.RegisterNotificationChannel(new MailNotificationChannel()); encoder.RegisterNotificationChannel(new SmsNotificationChannel()); encoder.Encode(new Video()); }
static void Main(string[] args) { var encoder = new VideoEncoder(); encoder.RegisterNotificationChannel(new MailNotifiactionChannel()); encoder.RegisterNotificationChannel(new SmsNotificationChannel()); encoder.Encode(new Video()); }
static void Main(string[] args) { var encoder = new VideoEncoder(); encoder.RegisterNotificationChannel(new MailNotificationChannel()); encoder.RegisterNotificationChannel(new SmsNotificationChannel()); Console.ReadLine(); }
static void Main(string[] args) { var videoEncoder = new VideoEncoder(); videoEncoder.RegistorNotificationChannel(new MailNotificationChannel()); videoEncoder.RegistorNotificationChannel(new SMSNotificationChannel()); videoEncoder.Encode(new Video()); }
public void Encode(VideoEncoder video) { // Video logic // ... foreach (var channel in _notificationChannels) { channel.Send(new Message()); } }
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()); }