2
0

IPlugin.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 type of configuration this plugin uses
  22. /// </summary>
  23. /// <value>The type of the configuration.</value>
  24. Type ConfigurationType { get; }
  25. /// <summary>
  26. /// Gets the unique id.
  27. /// </summary>
  28. /// <value>The unique id.</value>
  29. Guid Id { get; }
  30. /// <summary>
  31. /// Gets the plugin version
  32. /// </summary>
  33. /// <value>The version.</value>
  34. Version Version { get; }
  35. /// <summary>
  36. /// Gets the name the assembly file
  37. /// </summary>
  38. /// <value>The name of the assembly file.</value>
  39. string AssemblyFileName { get; }
  40. /// <summary>
  41. /// Gets a value indicating whether this instance is first run.
  42. /// </summary>
  43. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  44. bool IsFirstRun { get; }
  45. /// <summary>
  46. /// Gets the last date modified of the configuration
  47. /// </summary>
  48. /// <value>The configuration date last modified.</value>
  49. DateTime ConfigurationDateLastModified { get; }
  50. /// <summary>
  51. /// Gets the last date modified of the plugin
  52. /// </summary>
  53. /// <value>The assembly date last modified.</value>
  54. DateTime AssemblyDateLastModified { get; }
  55. /// <summary>
  56. /// Gets the path to the assembly file
  57. /// </summary>
  58. /// <value>The assembly file path.</value>
  59. string AssemblyFilePath { get; }
  60. /// <summary>
  61. /// Gets the plugin's configuration
  62. /// </summary>
  63. /// <value>The configuration.</value>
  64. BasePluginConfiguration Configuration { get; }
  65. /// <summary>
  66. /// Gets the name of the configuration file. Subclasses should override
  67. /// </summary>
  68. /// <value>The name of the configuration file.</value>
  69. string ConfigurationFileName { get; }
  70. /// <summary>
  71. /// Gets the full path to the configuration file
  72. /// </summary>
  73. /// <value>The configuration file path.</value>
  74. string ConfigurationFilePath { get; }
  75. /// <summary>
  76. /// Gets the full path to the data folder, where the plugin can store any miscellaneous files needed
  77. /// </summary>
  78. /// <value>The data folder path.</value>
  79. string DataFolderPath { get; }
  80. /// <summary>
  81. /// Saves the current configuration to the file system
  82. /// </summary>
  83. /// <exception cref="System.InvalidOperationException">Cannot call Plugin.SaveConfiguration from the UI.</exception>
  84. void SaveConfiguration();
  85. /// <summary>
  86. /// Completely overwrites the current configuration with a new copy
  87. /// Returns true or false indicating success or failure
  88. /// </summary>
  89. /// <param name="configuration">The configuration.</param>
  90. /// <exception cref="System.ArgumentNullException">configuration</exception>
  91. void UpdateConfiguration(BasePluginConfiguration configuration);
  92. /// <summary>
  93. /// Gets the plugin info.
  94. /// </summary>
  95. /// <returns>PluginInfo.</returns>
  96. PluginInfo GetPluginInfo();
  97. /// <summary>
  98. /// Called when just before the plugin is uninstalled from the server.
  99. /// </summary>
  100. void OnUninstalling();
  101. }
  102. }