diff options
| author | Luke <luke.pulverenti@gmail.com> | 2014-11-28 12:40:20 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2014-11-28 12:40:20 -0500 |
| commit | cc2d04d5bc85bbe824548ffa4bc43992afe819a3 (patch) | |
| tree | d423019bdeb7184d8d4250d0c414381b378f976d /MediaBrowser.Server.Mac/Main.cs | |
| parent | 9875c3a7e986382213b3c97b5da9a6cc9acff677 (diff) | |
updates for mac project
Diffstat (limited to 'MediaBrowser.Server.Mac/Main.cs')
| -rw-r--r-- | MediaBrowser.Server.Mac/Main.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs index 5618d02d5..2edc7b6b0 100644 --- a/MediaBrowser.Server.Mac/Main.cs +++ b/MediaBrowser.Server.Mac/Main.cs @@ -18,7 +18,6 @@ using MediaBrowser.Server.Implementations; using MediaBrowser.Server.Startup.Common; using MediaBrowser.Server.Startup.Common.Browser; using Microsoft.Win32; -using Microsoft.Win32; using MonoMac.AppKit; using MonoMac.Foundation; using MonoMac.ObjCRuntime; @@ -57,7 +56,7 @@ namespace MediaBrowser.Server.Mac NSApplication.Main (args); } - public static void AddDependencies(AppController appController){ + public static void AddDependencies(MenuBarIcon appController){ appController.AppHost = _appHost; appController.Logger = _logger; appController.ConfigurationManager = _appHost.ServerConfigurationManager; @@ -106,13 +105,16 @@ namespace MediaBrowser.Server.Mac Console.WriteLine ("appHost.Init"); - var initProgress = new Progress<double>(); + Task.Run (() => StartServer(CancellationToken.None)); + } - var task = _appHost.Init(initProgress); + private static async void StartServer(CancellationToken cancellationToken) + { + var initProgress = new Progress<double>(); - Task.WaitAll(task); + await _appHost.Init (initProgress).ConfigureAwait (false); - Task.Run (() => _appHost.RunStartupTasks()); + //await _appHost.RunStartupTasks ().ConfigureAwait (false); } /// <summary> @@ -139,7 +141,7 @@ namespace MediaBrowser.Server.Mac _appHost.Dispose (); _logger.Info("AppController.Terminate"); - AppController.Instance.Terminate (); + MenuBarIcon.Instance.Terminate (); } /// <summary> |
