IPlugin.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 the full path to the data folder, where the plugin can store any miscellaneous files needed
  38. /// </summary>
  39. /// <value>The data folder path.</value>
  40. string DataFolderPath { get; }
  41. /// <summary>
  42. /// Gets the plugin info.
  43. /// </summary>
  44. /// <returns>PluginInfo.</returns>
  45. PluginInfo GetPluginInfo();
  46. /// <summary>
  47. /// Called when just before the plugin is uninstalled from the server.
  48. /// </summary>
  49. void OnUninstalling();
  50. }
  51. public interface IHasPluginConfiguration
  52. {
  53. /// <summary>
  54. /// Gets the type of configuration this plugin uses
  55. /// </summary>
  56. /// <value>The type of the configuration.</value>
  57. Type ConfigurationType { get; }
  58. /// <summary>
  59. /// Completely overwrites the current configuration with a new copy
  60. /// Returns true or false indicating success or failure
  61. /// </summary>
  62. /// <param name="configuration">The configuration.</param>
  63. /// <exception cref="ArgumentNullException">configuration</exception>
  64. void UpdateConfiguration(BasePluginConfiguration configuration);
  65. /// <summary>
  66. /// Gets the plugin's configuration
  67. /// </summary>
  68. /// <value>The configuration.</value>
  69. BasePluginConfiguration Configuration { get; }
  70. void SetStartupInfo(Action<string> directoryCreateFn);
  71. }
  72. }