diff --git a/MediaBrowser.ServerApplication/Icons/Icon.ico b/MediaBrowser.ServerApplication/Icons/Icon.ico new file mode 100644 index 000000000..fa612891b Binary files /dev/null and b/MediaBrowser.ServerApplication/Icons/Icon.ico differ diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml b/MediaBrowser.ServerApplication/MainWindow.xaml index 71b28937e..9b851fae3 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml +++ b/MediaBrowser.ServerApplication/MainWindow.xaml @@ -1,8 +1,20 @@  + xmlns:tb="http://www.hardcodet.net/taskbar" + Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ShowInTaskbar="False" Closing="MainWindow_Closing" Loaded="MainWindow_Loaded"> - + + + + + + + + + + + + diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml.cs b/MediaBrowser.ServerApplication/MainWindow.xaml.cs index 09f98ff63..688ce19d5 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml.cs +++ b/MediaBrowser.ServerApplication/MainWindow.xaml.cs @@ -13,6 +13,9 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using MediaBrowser.Controller; +using MediaBrowser.Model.Progress; + namespace MediaBrowser.ServerApplication { /// @@ -20,9 +23,72 @@ namespace MediaBrowser.ServerApplication /// public partial class MainWindow : Window { + protected static Kernel kernel; + public MainWindow() { InitializeComponent(); + LoadKernel(); } + + private static void LoadKernel() + { + Progress progress = new Progress(); + SplashScreen splash = new SplashScreen(progress); + + try + { + DateTime now = DateTime.Now; + + splash.Show(); + + kernel = new Kernel(); + + kernel.Init(progress); + + var time = DateTime.Now - now; + } + catch + { + } + finally + { + splash.Close(); + } + } + + #region Main Window Events + + private void MainWindow_Loaded(object sender, RoutedEventArgs e) + { + // Don't show the system tray icon until the app has loaded. + this.MbTaskbarIcon.Visibility = System.Windows.Visibility.Visible; + } + + private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + kernel.Dispose(); + } + + #endregion + + #region Context Menu events + + private void cmOpenDashboard_click(object sender, RoutedEventArgs e) + { + + } + + private void cmVisitCT_click(object sender, RoutedEventArgs e) + { + + } + + private void cmExit_click(object sender, RoutedEventArgs e) + { + this.Close(); + } + + #endregion } } diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index 4b12db892..18deebfa7 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -56,6 +56,9 @@ MSBuild:Compile Designer + + SplashScreen.xaml + MSBuild:Compile Designer @@ -68,6 +71,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + @@ -97,6 +104,24 @@ + + + {9142eefa-7570-41e1-bfcc-468bb571af2f} + MediaBrowser.Common + + + {17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2} + MediaBrowser.Controller + + + {7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b} + MediaBrowser.Model + + + + + +