NativeApp.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using MediaBrowser.Model.Logging;
  2. using MediaBrowser.Server.Startup.Common;
  3. namespace MediaBrowser.Server.Mono.Native
  4. {
  5. /// <summary>
  6. /// Class NativeApp
  7. /// </summary>
  8. internal class NativeApp : BaseMonoApp
  9. {
  10. public NativeApp(StartupOptions startupOptions, ILogger logger)
  11. : base(startupOptions, logger)
  12. {
  13. }
  14. /// <summary>
  15. /// Shutdowns this instance.
  16. /// </summary>
  17. public override void Shutdown()
  18. {
  19. MainClass.Shutdown();
  20. }
  21. /// <summary>
  22. /// Determines whether this instance [can self restart].
  23. /// </summary>
  24. /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
  25. public override bool CanSelfRestart
  26. {
  27. get
  28. {
  29. // A restart script must be provided
  30. return StartupOptions.ContainsOption("-restartpath");
  31. }
  32. }
  33. /// <summary>
  34. /// Restarts this instance.
  35. /// </summary>
  36. public override void Restart(StartupOptions startupOptions)
  37. {
  38. MainClass.Restart(startupOptions);
  39. }
  40. }
  41. }