IPlugin.cs 2.5 KB

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