Esempio n. 1
0
        private List <PlaylistContainer.PlaylistInfo> LoadUserPlaylists()
        {
            string exceptionMessage = "";

            try
            {
                return(SpotifyController.GetAllSessionPlaylists());
            }
            // done this way so that we can recursively send this method on if the user chooses to retry
            catch (Exception ex)
            {
                exceptionMessage = ex.Message;
            }
            // handle problems - display dialog to user giving them a chance to retry this operation
            var dialog = MessageBox.Show(StringStore.ErrorDuringLoad + exceptionMessage + "\r\n\r\n" + StringStore.SelectRetryToTryAgainOrCancelToQuit, StringStore.ErrorDuringLoad, MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);

            if (dialog == DialogResult.Retry)
            {
                return(LoadUserPlaylists());
            }
            else
            {
                // user has cancelled loading playlists and chosen to exit
                this.Close();
                return(null);
            }
        }