2012-08-04 23:54:00 +00:00
|
|
|
|
using System;
|
2012-08-12 18:12:59 +00:00
|
|
|
|
using System.Diagnostics;
|
2012-08-04 23:54:00 +00:00
|
|
|
|
using System.Windows;
|
2012-08-05 00:10:44 +00:00
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
|
using MediaBrowser.Model.Progress;
|
|
|
|
|
|
2012-08-04 23:54:00 +00:00
|
|
|
|
namespace MediaBrowser.ServerApplication
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for MainWindow.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
|
{
|
|
|
|
|
public MainWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2012-08-05 00:10:44 +00:00
|
|
|
|
LoadKernel();
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-05 01:25:28 +00:00
|
|
|
|
private void LoadKernel()
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
|
|
|
|
Progress<TaskProgress> progress = new Progress<TaskProgress>();
|
2012-08-05 02:21:38 +00:00
|
|
|
|
Common.UI.Splash splash = new Common.UI.Splash(progress);
|
2012-08-05 00:10:44 +00:00
|
|
|
|
|
2012-08-17 13:16:50 +00:00
|
|
|
|
splash.Show();
|
|
|
|
|
|
2012-08-05 00:10:44 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
2012-08-05 01:25:28 +00:00
|
|
|
|
new Kernel().Init(progress);
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
2012-08-05 01:25:28 +00:00
|
|
|
|
catch (Exception ex)
|
2012-08-05 00:10:44 +00:00
|
|
|
|
{
|
2012-08-17 13:16:50 +00:00
|
|
|
|
MessageBox.Show("There was an error launching Media Browser Server: " + ex.Message);
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Context Menu events
|
|
|
|
|
|
|
|
|
|
private void cmOpenDashboard_click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2012-08-05 16:09:45 +00:00
|
|
|
|
App.OpenDashboard();
|
2012-08-04 23:54:00 +00:00
|
|
|
|
}
|
2012-08-05 00:10:44 +00:00
|
|
|
|
|
|
|
|
|
private void cmVisitCT_click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2012-08-12 18:12:59 +00:00
|
|
|
|
using (Process process = Process.Start("http://community.mediabrowser.tv/"))
|
|
|
|
|
{
|
|
|
|
|
}
|
2012-08-05 00:10:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmExit_click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
2012-08-04 23:54:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|