예제 #1
0
        void Start()
        {
            IObservable player      = new MP3Player();
            IObserver   mp3Display1 = new SimpleMP3Display(player);
            IObserver   mp3Display2 = new FancyMP3Display(player);

            //I have added songs in program.cs I hope this is the correct way to do it.
            player.NextSong();
            player.NextSong();
            player.NextSong();
        }
예제 #2
0
        void Start()
        {
            IObservable player = new MP3Player();

            IObserver mp3Display1 = new SimpleMP3Display(player);
            IObserver mp3Display2 = new FancyMP3Display(player);

            player.NextSong();
            player.NextSong();
            player.NextSong();

            Console.ReadKey();
        }