void OnSearchComplete(Search aResult, object aUserdata) { try { aResult.Error(); PrintSearch(aResult); } catch (SpotifyException e) { Console.Error.WriteLine("Failed to search: {0}", e.Message); } aResult.Dispose(); iConsoleReader.RequestInput("> "); }
void PrintSearch(Search aSearch) { Console.WriteLine("Query : {0}", aSearch.Query()); Console.WriteLine("Did you mean : {0}", aSearch.DidYouMean()); Console.WriteLine("Tracks in total: {0}", aSearch.TotalTracks()); Console.WriteLine(); for (int i=0; i!=aSearch.NumTracks(); ++i) Printing.PrintTrack(iSession, aSearch.Track(i)); for (int i=0; i!=aSearch.NumAlbums(); ++i) PrintAlbum(iSession, aSearch.Album(i)); for (int i=0; i!=aSearch.NumArtists(); ++i) PrintArtist(iSession, aSearch.Artist(i)); for (int i=0; i!=aSearch.NumPlaylists(); ++i) Console.WriteLine(" Playlist \"{0}\"", aSearch.PlaylistName(i)); }