예제 #1
0
        public async Task StepByStep()
        {
            BaiduRestService.GetService(this.Client.RestClient).Responsed += BaiduSongListServiceTest_Responsed;
            SongListContent songlistContent = await BaiduSongListService.GetService(this.Client).GedanAsync(1);

            foreach (var songlist in songlistContent.SongLists)
            {
                SongListInfoContent songlistInfoContent = await BaiduSongListService.GetService(this.Client).GedanInfoAsync(songlist.ListId);

                foreach (var song in songlistInfoContent.Songs)
                {
                    SongInfoContent songInfoContent = await BaiduSongService.GetService(this.Client).GetInfoAsync(song.SongId);

                    song.CopyFrom(songInfoContent.Item);
                }
            }
            BaiduRestService.GetService(this.Client.RestClient).Responsed -= BaiduSongListServiceTest_Responsed;
        }
예제 #2
0
        private async void AddMore()
        {
            isLoading = true;
            SongListContent content = await ServiceProvider.GetService <ISongListService>().GedanAsync(page, pageSize);

            if (!content.HasError)
            {
                foreach (var item in content.SongLists)
                {
                    this.SongLists.Add((SongList)item);
                }
                page++;
            }
            else
            {
                MessageBox.Show(content.Exception.Message);
            }
            isLoading = false;
        }