IPlugin.cs 2.4 KB

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