diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-19 00:52:49 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-19 00:52:49 -0500 |
| commit | 65a1ef020b205b1676bd7dd70e7261a1fa29b7a2 (patch) | |
| tree | b9130379ceead0c3ca1495a7b41ff97baab14040 /Emby.Server.Implementations/Browser/BrowserLauncher.cs | |
| parent | e58e34ceca52914bd2475c76ede5f7ee91964d00 (diff) | |
move sync repository to portable project
Diffstat (limited to 'Emby.Server.Implementations/Browser/BrowserLauncher.cs')
| -rw-r--r-- | Emby.Server.Implementations/Browser/BrowserLauncher.cs | 73 |
1 files changed, 73 insertions, 0 deletions
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 +{ + /// <summary> + /// Class BrowserLauncher + /// </summary> + public static class BrowserLauncher + { + /// <summary> + /// Opens the dashboard page. + /// </summary> + /// <param name="page">The page.</param> + /// <param name="appHost">The app host.</param> + public static void OpenDashboardPage(string page, IServerApplicationHost appHost) + { + var url = appHost.GetLocalApiUrl("localhost") + "/web/" + page; + + OpenUrl(appHost, url); + } + + /// <summary> + /// Opens the community. + /// </summary> + public static void OpenCommunity(IServerApplicationHost appHost) + { + OpenUrl(appHost, "http://emby.media/community"); + } + + public static void OpenEmbyPremiere(IServerApplicationHost appHost) + { + OpenDashboardPage("supporterkey.html", appHost); + } + + /// <summary> + /// Opens the web client. + /// </summary> + /// <param name="appHost">The app host.</param> + public static void OpenWebClient(IServerApplicationHost appHost) + { + OpenDashboardPage("index.html", appHost); + } + + /// <summary> + /// Opens the dashboard. + /// </summary> + /// <param name="appHost">The app host.</param> + public static void OpenDashboard(IServerApplicationHost appHost) + { + OpenDashboardPage("dashboard.html", appHost); + } + + /// <summary> + /// Opens the URL. + /// </summary> + /// <param name="url">The URL.</param> + private static void OpenUrl(IServerApplicationHost appHost, string url) + { + try + { + appHost.LaunchUrl(url); + } + catch (NotImplementedException) + { + + } + catch (Exception) + { + } + } + } +} |
