App.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using Microsoft.Shell;
  9. using MediaBrowser.Controller;
  10. namespace MediaBrowser.ServerApplication
  11. {
  12. /// <summary>
  13. /// Interaction logic for App.xaml
  14. /// </summary>
  15. public partial class App : Application, ISingleInstanceApp
  16. {
  17. private const string Unique = "MediaBrowser3";
  18. [STAThread]
  19. public static void Main()
  20. {
  21. if (SingleInstance<App>.InitializeAsFirstInstance(Unique))
  22. {
  23. var application = new App();
  24. application.InitializeComponent();
  25. application.Run();
  26. // Allow single instance code to perform cleanup operations
  27. SingleInstance<App>.Cleanup();
  28. }
  29. }
  30. #region ISingleInstanceApp Members
  31. public bool SignalExternalCommandLineArgs(IList<string> args)
  32. {
  33. OpenDashboard();
  34. return true;
  35. }
  36. #endregion
  37. protected override void OnExit(ExitEventArgs e)
  38. {
  39. base.OnExit(e);
  40. Kernel.Instance.Dispose();
  41. }
  42. public static void OpenDashboard()
  43. {
  44. }
  45. }
  46. }