Ejemplo n.º 1
0
        private void GetArtistList()
        {
            var artistCountRequest = new GetNumberAllArtistStoreRequest();

            artistCountRequest.ProcessSuccessfully += (reply) =>
            {
                var listArtistRequest = new ListAllArtistStoreRequest(0, reply.number_all_artist.number_artist - 1);
                listArtistRequest.ProcessSuccessfully += (listReply) =>
                                                         Dispatcher.BeginInvoke((Action) delegate
                {
                    foreach (var info in listReply.list_artist.artist_short_info)
                    {
                        var artistItem = new ArtistItemVertical();
                        artistItem.SetInfo(info);
                        artistItem.ArtistItemClicked += artistItem_ArtistItemClicked;
                        ViewModel.ArtistsList.Add(artistItem);
                        DownloadImage(info.artist_id, info.avatar_url, artistItem);
                    }
                });
                listArtistRequest.ProcessError += (listReply, msg) =>
                {
                    Debug.Assert(false, msg);
                    Dispatcher.BeginInvoke((Action)(() => StaticMainWindow.Window.ShowErrorScreen()));
                };
                GlobalVariables.StoreWorker.ForceAddRequest(listArtistRequest);
            };
            artistCountRequest.ProcessError += (reply, msg) =>
            {
                Debug.Assert(false, msg);
                Dispatcher.BeginInvoke((Action)(() => StaticMainWindow.Window.ShowErrorScreen()));
            };
            GlobalVariables.StoreWorker.ForceAddRequest(artistCountRequest);
        }
Ejemplo n.º 2
0
 private void GetArtistList()
 {
     var artistCountRequest = new GetNumberAllArtistStoreRequest();
     artistCountRequest.ProcessSuccessfully += (reply) =>
     {
         var listArtistRequest = new ListAllArtistStoreRequest(0, reply.number_all_artist.number_artist - 1);
         listArtistRequest.ProcessSuccessfully += (listReply) =>
             Dispatcher.BeginInvoke((Action)delegate
             {
                 foreach (var info in listReply.list_artist.artist_short_info)
                 {
                     var artistItem = new ArtistItemVertical();
                     artistItem.SetInfo(info);
                     artistItem.ArtistItemClicked += artistItem_ArtistItemClicked;
                     ViewModel.ArtistsList.Add(artistItem);
                     DownloadImage(info.artist_id, info.avatar_url, artistItem);
                 }
             });
         listArtistRequest.ProcessError += (listReply, msg) =>
         {
             Debug.Assert(false, msg);
             Dispatcher.BeginInvoke((Action)(() => StaticMainWindow.Window.ShowErrorScreen()));
         };
         GlobalVariables.StoreWorker.ForceAddRequest(listArtistRequest);
     };
     artistCountRequest.ProcessError += (reply, msg) =>
     {
         Debug.Assert(false, msg);
         Dispatcher.BeginInvoke((Action)(() => StaticMainWindow.Window.ShowErrorScreen()));
     };
     GlobalVariables.StoreWorker.ForceAddRequest(artistCountRequest);
 }