From cc2d04d5bc85bbe824548ffa4bc43992afe819a3 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 28 Nov 2014 12:40:20 -0500 Subject: updates for mac project --- MediaBrowser.Server.Mac/Main.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Server.Mac/Main.cs') diff --git a/MediaBrowser.Server.Mac/Main.cs b/MediaBrowser.Server.Mac/Main.cs index 5618d02d5a..2edc7b6b06 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(); + Task.Run (() => StartServer(CancellationToken.None)); + } - var task = _appHost.Init(initProgress); + private static async void StartServer(CancellationToken cancellationToken) + { + var initProgress = new Progress(); - Task.WaitAll(task); + await _appHost.Init (initProgress).ConfigureAwait (false); - Task.Run (() => _appHost.RunStartupTasks()); + //await _appHost.RunStartupTasks ().ConfigureAwait (false); } /// @@ -139,7 +141,7 @@ namespace MediaBrowser.Server.Mac _appHost.Dispose (); _logger.Info("AppController.Terminate"); - AppController.Instance.Terminate (); + MenuBarIcon.Instance.Terminate (); } /// -- cgit v1.2.3