Exemplo n.º 1
0
        static void Main(string[] args)
        {
            YouTubeChannel Youtube = new YouTubeChannel(); //Create new youtube account!

            ISubscriber Joey = new User();
            ISubscriber Alex = new User();
            ISubscriber Gai  = new Moderator();

            Youtube.Subscribe(Joey);
            Youtube.Subscribe(Alex);
            Youtube.Subscribe(Gai);

            Youtube.NotifySubscribers(); //I upload a new video!

            Console.WriteLine("Alex unsubscribed");
            Youtube.Unsubscribe(Alex);

            Youtube.NotifySubscribers();
            Console.Read();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            YouTubeChannel myChannel = new YouTubeChannel();

            ISubscriber joey = new User("Joey");
            ISubscriber alex = new User("Alex");
            ISubscriber guy  = new Moderator();

            myChannel.Subscribe(joey);
            myChannel.Subscribe(alex);
            myChannel.Subscribe(guy);

            myChannel.NotifySubscribers();

            Console.ReadKey();

            myChannel.Unsubscribe(alex);
            myChannel.NotifySubscribers();

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            YouTubeChannel RedChannel = new YouTubeChannel(); // Create new youtube account.

            ISubscriber Joey = new User();
            ISubscriber Alex = new User();
            ISubscriber Gal  = new Moderator();

            RedChannel.Subscribe(Joey);
            RedChannel.Subscribe(Alex);
            RedChannel.Subscribe(Gal);

            Console.WriteLine(" --- I upload a new video. --- ");
            RedChannel.NotifySubscribers(); // I upload a new video.

            Console.WriteLine(" --- Alex unsubscribe. --- ");
            RedChannel.Unsubscribe(Alex);

            Console.WriteLine(" --- I upload a new video. --- ");
            RedChannel.NotifySubscribers(); // I upload a new video.

            Console.ReadKey();
        }