public void LaunchApp(RokuApp app) { if (SelectedRoku == null) { MessageBox.Show("No Roku Selected!"); return; } RokuAccessor.LaunchRokuApp(SelectedRoku, app); }
static void Search(IRokuRemote roku) { RokuApp app = null; int? appId = null; SearchType?type = null; int? season = null; bool launch = false; Console.Write($"Search for: "); var keyword = Console.ReadLine(); if (string.IsNullOrWhiteSpace(keyword)) { Console.WriteLine("Cancelled."); return; } type = SelectSearchType("(optional) search type: "); if (type != null && type.Value == SearchType.TVShow) { season = ParseChoice("(optional) season: ", 1, 99); } app = SelectApp(roku, "(optional) app to search in: "); Console.Write($"Searching for \"{keyword}\""); if (type != null) { Console.Write($" of type {type}"); if (type.Value == SearchType.TVShow && season != null) { Console.Write($" season {season}"); } } if (app != null) { appId = app.Id; launch = true; Console.Write($" in {app.Text}"); } roku.SearchAsync(keyword, type, season, appId, launch).Wait(); Console.WriteLine(); }
public static void LaunchRokuApp(Roku roku, RokuApp app) { var launchUrl = roku.Url + "launch/" + app.Id; _ = HTTPTools.PostAsync(launchUrl); }