Ejemplo n.º 1
0
        private void DeletePlaylistExecute()
        {
            _delete = true;
            var request = new HttpRequestGet();

            ValidateKey.GetValideKey();
            var resDel = request.DeletePlaylist(SelectedPlaylist, Singleton.Singleton.Instance().SecureKey,
                Singleton.Singleton.Instance().CurrentUser);

            resDel.ContinueWith(delegate(Task<string> tmp)
            {
                var test = tmp.Result;
                if (test != null)
                {
                    CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        var stringJson = JObject.Parse(test).SelectToken("code").ToString();
                        if (stringJson == "202")
                        {
                            new MessageDialog(loader.GetString("ErrorDeletePlaylist")).ShowAsync();
                            RefreshPlaylist();
                        }
                        else
                            new MessageDialog("Delete Fail code: " + stringJson).ShowAsync();
                    });
                }
            });
        }