From 65a1ef020b205b1676bd7dd70e7261a1fa29b7a2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Nov 2016 00:52:49 -0500 Subject: move sync repository to portable project --- .../Browser/BrowserLauncher.cs | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Emby.Server.Implementations/Browser/BrowserLauncher.cs (limited to 'Emby.Server.Implementations/Browser') diff --git a/Emby.Server.Implementations/Browser/BrowserLauncher.cs b/Emby.Server.Implementations/Browser/BrowserLauncher.cs new file mode 100644 index 000000000..05cde91e2 --- /dev/null +++ b/Emby.Server.Implementations/Browser/BrowserLauncher.cs @@ -0,0 +1,73 @@ +using MediaBrowser.Controller; +using System; + +namespace Emby.Server.Implementations.Browser +{ + /// + /// Class BrowserLauncher + /// + public static class BrowserLauncher + { + /// + /// Opens the dashboard page. + /// + /// The page. + /// The app host. + public static void OpenDashboardPage(string page, IServerApplicationHost appHost) + { + var url = appHost.GetLocalApiUrl("localhost") + "/web/" + page; + + OpenUrl(appHost, url); + } + + /// + /// Opens the community. + /// + public static void OpenCommunity(IServerApplicationHost appHost) + { + OpenUrl(appHost, "http://emby.media/community"); + } + + public static void OpenEmbyPremiere(IServerApplicationHost appHost) + { + OpenDashboardPage("supporterkey.html", appHost); + } + + /// + /// Opens the web client. + /// + /// The app host. + public static void OpenWebClient(IServerApplicationHost appHost) + { + OpenDashboardPage("index.html", appHost); + } + + /// + /// Opens the dashboard. + /// + /// The app host. + public static void OpenDashboard(IServerApplicationHost appHost) + { + OpenDashboardPage("dashboard.html", appHost); + } + + /// + /// Opens the URL. + /// + /// The URL. + private static void OpenUrl(IServerApplicationHost appHost, string url) + { + try + { + appHost.LaunchUrl(url); + } + catch (NotImplementedException) + { + + } + catch (Exception) + { + } + } + } +} -- cgit v1.2.3