Exemplo n.º 1
0
 public void Update(Locker locker, List<Track> tracks)
 {
     Console.WriteLine(GetType().Name);
     Console.WriteLine("====================");
     Console.WriteLine(String.Format("Downloaded {0} track(s) to disk", tracks.Count));
     //Download tracks
     Console.WriteLine();
 }
Exemplo n.º 2
0
        public void Update(Locker locker,List<Track> tracks)
        {
            Console.WriteLine(this.GetType().Name);
            Console.WriteLine("====================");

            Console.WriteLine("Look mum, I just bought some music!");
            //Publish tracks to Facebook/Twitter
            Console.WriteLine();
        }
Exemplo n.º 3
0
 private void DisplayTracks(Locker locker, List<Track> tracks)
 {
     Console.WriteLine(this.GetType().Name);
     Console.WriteLine("====================");
     Console.WriteLine("This is your locker : ");
     foreach (var track in tracks)
     {
         Console.WriteLine("-------");
         Console.WriteLine(track.Artist);
         Console.WriteLine(track.Title);
     }
     Console.WriteLine();
     //Update phone display
 }
        public void Run()
        {
            var tracks = new List<Track>()
            {
                new Track {Artist = "Radiohead", Title = "Codex"},
                new Track {Artist = "Pulp", Title = "Disco 2000"}
            };
            var locker =new Locker(tracks);

            var phoneObserver = new PhoneObserver(locker);

            locker.AddTrack("Flim", "Aphex Twin");

            new DesktopObserver(locker);
            new SocialObserver(locker);

            locker.AddTrack("Get A Move ON", "Mr. Scruff");

            phoneObserver.ConnectionDropped();

            locker.AddTrack("Plug in Baby", "Muse");
        }
Exemplo n.º 5
0
 public PhoneObserver(Locker locker)
 {
     _locker = locker;
     Connect();
 }
Exemplo n.º 6
0
 public SocialObserver(Locker locker)
 {
     _locker = locker;
     Connect();
 }
Exemplo n.º 7
0
 //private Locker. _lockerOnTracksChanged;
 public DesktopObserver(Locker locker)
 {
     _locker = locker;
     Connect();
 }