Jelajahi Sumber

Removed static and added an error message

LukePulverenti Luke Pulverenti luke pulverenti 13 tahun lalu
induk
melakukan
10551b6804
1 mengubah file dengan 4 tambahan dan 7 penghapusan
  1. 4 7
      MediaBrowser.ServerApplication/MainWindow.xaml.cs

+ 4 - 7
MediaBrowser.ServerApplication/MainWindow.xaml.cs

@@ -23,15 +23,13 @@ namespace MediaBrowser.ServerApplication
     /// </summary>
     /// </summary>
     public partial class MainWindow : Window
     public partial class MainWindow : Window
     {
     {
-        protected static Kernel kernel;
-
         public MainWindow()
         public MainWindow()
         {
         {
             InitializeComponent();
             InitializeComponent();
             LoadKernel();
             LoadKernel();
         }
         }
 
 
-        private static void LoadKernel()
+        private void LoadKernel()
         {
         {
             Progress<TaskProgress> progress = new Progress<TaskProgress>();
             Progress<TaskProgress> progress = new Progress<TaskProgress>();
             SplashScreen splash = new SplashScreen(progress);
             SplashScreen splash = new SplashScreen(progress);
@@ -40,12 +38,11 @@ namespace MediaBrowser.ServerApplication
             {
             {
                 splash.Show();
                 splash.Show();
 
 
-                kernel = new Kernel();
-
-                kernel.Init(progress);
+                new Kernel().Init(progress);
             }
             }
-            catch
+            catch (Exception ex)
             {
             {
+                MessageBox.Show("There was an error launching Media Browser: " + ex.Message);
             }
             }
             finally
             finally
             {
             {