Exemplo n.º 1
0
        private void OnEndDownload(RestResponse response)
        {
            if (response.StatusCode != HttpStatusCode.OK)
            {
                m_Listener.Error(CreateErrorDescription(response));
                return;
            }

            try
            {
                var deserializer = new XmlDeserializer {
                    Namespace = "", RootElement = ""
                };
                var playLists = deserializer.Deserialize <PlayLists>(response);

                m_Listener.PlayListsDownloaded(playLists.Items.Select(CreatePlayList).ToArray());
            }
            catch (Exception exception)
            {
                m_Listener.Error(new ErrorDescription(response.StatusCode, response.StatusDescription, response.Content, exception));
            }
        }
 public void PlayListsDownloaded(PlayList[] playLists)
 {
     Synchronize(() => m_Listener.PlayListsDownloaded(playLists));
 }