From f3ce127a62714c97747f1e9575aaea1e9cdb3b6a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 20 Sep 2013 13:32:10 -0400 Subject: starting point towards running as a service --- MediaBrowser.ServerApplication/MainWindow.xaml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.ServerApplication/MainWindow.xaml.cs') diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml.cs b/MediaBrowser.ServerApplication/MainWindow.xaml.cs index 974bb6f48..4dcdeef59 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml.cs +++ b/MediaBrowser.ServerApplication/MainWindow.xaml.cs @@ -119,7 +119,7 @@ namespace MediaBrowser.ServerApplication Dispatcher.InvokeAsync(() => { - var logWindow = App.Instance.Windows.OfType().FirstOrDefault(); + var logWindow = App.Current.Windows.OfType().FirstOrDefault(); if ((logWindow == null && _configurationManager.Configuration.ShowLogWindow) || (logWindow != null && !_configurationManager.Configuration.ShowLogWindow)) { @@ -204,7 +204,7 @@ namespace MediaBrowser.ServerApplication { App.OpenUrl("https://github.com/MediaBrowser/MediaBrowser/wiki"); } - + /// /// Occurs when [property changed]. /// @@ -258,7 +258,7 @@ namespace MediaBrowser.ServerApplication { App.OpenDashboardPage("dashboard.html", loggedInUser, _configurationManager, _appHost); } - + /// /// Handles the click event of the cmVisitCT control. /// @@ -285,9 +285,9 @@ namespace MediaBrowser.ServerApplication /// /// The source of the event. /// The instance containing the event data. - private void cmExit_click(object sender, RoutedEventArgs e) + private async void cmExit_click(object sender, RoutedEventArgs e) { - Application.Current.Shutdown(); + await _appHost.Shutdown().ConfigureAwait(false); } /// @@ -295,9 +295,9 @@ namespace MediaBrowser.ServerApplication /// /// The source of the event. /// The instance containing the event data. - private void cmdReloadServer_click(object sender, RoutedEventArgs e) + private async void cmdReloadServer_click(object sender, RoutedEventArgs e) { - App.Instance.Restart(); + await _appHost.Restart().ConfigureAwait(false); } /// -- cgit v1.2.3