예제 #1
0
 public void LaunchApp(RokuApp app)
 {
     if (SelectedRoku == null)
     {
         MessageBox.Show("No Roku Selected!");
         return;
     }
     RokuAccessor.LaunchRokuApp(SelectedRoku, app);
 }
예제 #2
0
파일: Program.cs 프로젝트: yozepi/Roku.Net
        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();
        }
예제 #3
0
        public static void LaunchRokuApp(Roku roku, RokuApp app)
        {
            var launchUrl = roku.Url + "launch/" + app.Id;

            _ = HTTPTools.PostAsync(launchUrl);
        }