MainWindow.xaml.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using MediaBrowser.Controller;
  16. using MediaBrowser.Model.Progress;
  17. namespace MediaBrowser.ServerApplication
  18. {
  19. /// <summary>
  20. /// Interaction logic for MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24. public MainWindow()
  25. {
  26. InitializeComponent();
  27. LoadKernel();
  28. }
  29. private void LoadKernel()
  30. {
  31. Progress<TaskProgress> progress = new Progress<TaskProgress>();
  32. SplashScreen splash = new SplashScreen(progress);
  33. try
  34. {
  35. splash.Show();
  36. new Kernel().Init(progress);
  37. }
  38. catch (Exception ex)
  39. {
  40. MessageBox.Show("There was an error launching Media Browser: " + ex.Message);
  41. }
  42. finally
  43. {
  44. splash.Close();
  45. }
  46. }
  47. #region Main Window Events
  48. private void MainWindow_Loaded(object sender, RoutedEventArgs e)
  49. {
  50. // Don't show the system tray icon until the app has loaded.
  51. this.MbTaskbarIcon.Visibility = System.Windows.Visibility.Visible;
  52. }
  53. #endregion
  54. #region Context Menu events
  55. private void cmOpenDashboard_click(object sender, RoutedEventArgs e)
  56. {
  57. }
  58. private void cmVisitCT_click(object sender, RoutedEventArgs e)
  59. {
  60. }
  61. private void cmExit_click(object sender, RoutedEventArgs e)
  62. {
  63. this.Close();
  64. }
  65. #endregion
  66. }
  67. }