public void Encode(VideoEncoder video) { foreach (var channel in _notificationChannels) { channel.Send(new Message()); } }
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.RegisterNotificationChanel(new MailNotificationChanel()); encoder.RegisterNotificationChanel(new SMSNotificationChanel()); encoder.Encode(new Video()); Console.WriteLine("Finish"); Console.ReadKey(); }