Ejemplo n.º 1
0
 private void _songDetailViewController_downloadButtonPressed(Song song)
 {
     if (!SongDownloader.Instance.IsSongDownloaded(song))
     {
         _downloadQueueViewController.EnqueueSong(song, true);
         _songDetailViewController.SetDownloadState(DownloadState.Downloading);
     }
     else
     {
         _simpleDialog.Init("Delete song", $"Do you really want to delete \"{song.songName} {song.songSubName}\"?", "Delete", "Cancel",
                            (selectedButton) =>
         {
             DismissViewController(_simpleDialog, null, false);
             if (selectedButton == 0)
             {
                 DeleteSong(_lastSelectedSong);
             }
         });
         PresentViewController(_simpleDialog, null, false);
     }
 }
 private void _songDetailViewController_downloadButtonPressed(Song song)
 {
     if (!SongDownloader.Instance.IsSongDownloaded(song))
     {
         _downloadQueueViewController.EnqueueSong(song, true);
         _songDetailViewController.SetDownloadState(DownloadState.Downloading);
     }
     else
     {
         _simpleDialog.Init("Delete song", $"Do you really want to delete \"{ song.songName} {song.songSubName}\"?", "Delete", "Cancel");
         _simpleDialog.didFinishEvent -= (SimpleDialogPromptViewController sender, bool delete) => { DismissViewController(_simpleDialog, null, false); if (delete)
                                                                                                     {
                                                                                                         DeleteSong(song);
                                                                                                     }
         };
         _simpleDialog.didFinishEvent += (SimpleDialogPromptViewController sender, bool delete) => { DismissViewController(_simpleDialog, null, false); if (delete)
                                                                                                     {
                                                                                                         DeleteSong(song);
                                                                                                     }
         };
         PresentViewController(_simpleDialog, null, false);
     }
 }