Exemplo n.º 1
0
        private void TrackListChunkRecv(HttpWebRequest request, HttpWebResponse response, String jsonData, Exception error)
        {
            if (error != null)
            {
                OnError(error);
                return;
            }

            GoogleMusicPlaylist chunk =
                Newtonsoft.Json.JsonConvert.DeserializeObject <GoogleMusicPlaylist>(jsonData);

            trackContainer.AddRange(chunk.Songs);

            if (!String.IsNullOrEmpty(chunk.ContToken))
            {
                GetAllSongs(chunk.ContToken);
            }
            else
            {
                if (OnGetAllSongsComplete != null)
                {
                    OnGetAllSongsComplete(trackContainer);
                }
            }
        }
 private void doLoadSongList(GoogleMusicPlaylist playlist)
 {
     this.IsLoadingSongs = true;
     if (playlist == null)
     {
         if (GooglePlayHandler.AllSongs == null)
         {
             if (GetAllSongs())
             {
                 SortedSet<GoogleMusicSong> sortAll = new SortedSet<GoogleMusicSong>(GooglePlayHandler.AllSongs, new GoogleMusicSongComparer());
                 this.SongList = sortAll.ToList();
             }
         }
     }
     else
         this.SongList = playlist.Songs;
     this.IsLoadingSongs = false;
 }