IPlugin.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #pragma warning disable CS1591
  2. using System;
  3. using MediaBrowser.Model.Plugins;
  4. namespace MediaBrowser.Common.Plugins
  5. {
  6. /// <summary>
  7. /// Interface IPlugin.
  8. /// </summary>
  9. public interface IPlugin
  10. {
  11. /// <summary>
  12. /// Gets the name of the plugin.
  13. /// </summary>
  14. /// <value>The name.</value>
  15. string Name { get; }
  16. /// <summary>
  17. /// Gets the description.
  18. /// </summary>
  19. /// <value>The description.</value>
  20. string Description { get; }
  21. /// <summary>
  22. /// Gets the unique id.
  23. /// </summary>
  24. /// <value>The unique id.</value>
  25. Guid Id { get; }
  26. /// <summary>
  27. /// Gets the plugin version.
  28. /// </summary>
  29. /// <value>The version.</value>
  30. Version Version { get; }
  31. /// <summary>
  32. /// Gets the path to the assembly file.
  33. /// </summary>
  34. /// <value>The assembly file path.</value>
  35. string AssemblyFilePath { get; }
  36. /// <summary>
  37. /// Gets a value indicating whether the plugin can be uninstalled.
  38. /// </summary>
  39. bool CanUninstall { get; }
  40. /// <summary>
  41. /// Gets the full path to the data folder, where the plugin can store any miscellaneous files needed.
  42. /// </summary>
  43. /// <value>The data folder path.</value>
  44. string DataFolderPath { get; }
  45. /// <summary>
  46. /// Gets the plugin info.
  47. /// </summary>
  48. /// <returns>PluginInfo.</returns>
  49. PluginInfo GetPluginInfo();
  50. /// <summary>
  51. /// Called when just before the plugin is uninstalled from the server.
  52. /// </summary>
  53. void OnUninstalling();
  54. }
  55. public interface IHasPluginConfiguration
  56. {
  57. /// <summary>
  58. /// Gets the type of configuration this plugin uses.
  59. /// </summary>
  60. /// <value>The type of the configuration.</value>
  61. Type ConfigurationType { get; }
  62. /// <summary>
  63. /// Gets the plugin's configuration.
  64. /// </summary>
  65. /// <value>The configuration.</value>
  66. BasePluginConfiguration Configuration { get; }
  67. /// <summary>
  68. /// Completely overwrites the current configuration with a new copy
  69. /// Returns true or false indicating success or failure.
  70. /// </summary>
  71. /// <param name="configuration">The configuration.</param>
  72. /// <exception cref="ArgumentNullException"><c>configuration</c> is <c>null</c>.</exception>
  73. void UpdateConfiguration(BasePluginConfiguration configuration);
  74. void SetStartupInfo(Action<string> directoryCreateFn);
  75. }
  76. }