INativeApp.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Model.Logging;
  3. using System.Collections.Generic;
  4. using System.Reflection;
  5. namespace MediaBrowser.Server.Startup.Common
  6. {
  7. public interface INativeApp
  8. {
  9. /// <summary>
  10. /// Gets the assemblies with parts.
  11. /// </summary>
  12. /// <returns>List&lt;Assembly&gt;.</returns>
  13. List<Assembly> GetAssembliesWithParts();
  14. /// <summary>
  15. /// Authorizes the server.
  16. /// </summary>
  17. /// <param name="udpPort">The UDP port.</param>
  18. /// <param name="httpServerPort">The HTTP server port.</param>
  19. /// <param name="tempDirectory">The temporary directory.</param>
  20. void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory);
  21. /// <summary>
  22. /// Gets the environment.
  23. /// </summary>
  24. /// <value>The environment.</value>
  25. NativeEnvironment Environment { get; }
  26. /// <summary>
  27. /// Gets a value indicating whether [supports running as service].
  28. /// </summary>
  29. /// <value><c>true</c> if [supports running as service]; otherwise, <c>false</c>.</value>
  30. bool SupportsRunningAsService { get; }
  31. /// <summary>
  32. /// Gets a value indicating whether this instance is running as service.
  33. /// </summary>
  34. /// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
  35. bool IsRunningAsService { get; }
  36. /// <summary>
  37. /// Gets a value indicating whether this instance can self restart.
  38. /// </summary>
  39. /// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
  40. bool CanSelfRestart { get; }
  41. /// <summary>
  42. /// Gets a value indicating whether [supports autorun at startup].
  43. /// </summary>
  44. /// <value><c>true</c> if [supports autorun at startup]; otherwise, <c>false</c>.</value>
  45. bool SupportsAutoRunAtStartup { get; }
  46. /// <summary>
  47. /// Gets a value indicating whether this instance can self update.
  48. /// </summary>
  49. /// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
  50. bool CanSelfUpdate { get; }
  51. /// <summary>
  52. /// Shutdowns this instance.
  53. /// </summary>
  54. void Shutdown();
  55. /// <summary>
  56. /// Restarts this instance.
  57. /// </summary>
  58. void Restart();
  59. /// <summary>
  60. /// Configures the automatic run.
  61. /// </summary>
  62. /// <param name="autorun">if set to <c>true</c> [autorun].</param>
  63. void ConfigureAutoRun(bool autorun);
  64. /// <summary>
  65. /// Gets the network manager.
  66. /// </summary>
  67. /// <returns>INetworkManager.</returns>
  68. INetworkManager CreateNetworkManager(ILogger logger);
  69. /// <summary>
  70. /// Prevents the system stand by.
  71. /// </summary>
  72. void PreventSystemStandby();
  73. }
  74. }