IPluginFinder.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace GreenTree.Nachtragsmanagement.Core.Plugins
  7. {
  8. /// <summary>
  9. /// Plugin finder
  10. /// </summary>
  11. public interface IPluginFinder
  12. {
  13. /// <summary>
  14. /// Gets plugin groups
  15. /// </summary>
  16. /// <returns>Plugins groups</returns>
  17. IEnumerable<string> GetPluginGroups();
  18. /// <summary>
  19. /// Gets plugins
  20. /// </summary>
  21. /// <typeparam name="T">The type of plugins to get.</typeparam>
  22. /// <param name="loadMode">Load plugins mode</param>
  23. /// <param name="storeId">Load records allowed only in a specified store; pass 0 to load all records</param>
  24. /// <param name="group">Filter by plugin group; pass null to load all records</param>
  25. /// <returns>Plugins</returns>
  26. IEnumerable<T> GetPlugins<T>(LoadPluginsMode loadMode = LoadPluginsMode.InstalledOnly,
  27. int storeId = 0, string group = null) where T : class, IPlugin;
  28. /// <summary>
  29. /// Get plugin descriptors
  30. /// </summary>
  31. /// <param name="loadMode">Load plugins mode</param>
  32. /// <param name="storeId">Load records allowed only in a specified store; pass 0 to load all records</param>
  33. /// <param name="group">Filter by plugin group; pass null to load all records</param>
  34. /// <returns>Plugin descriptors</returns>
  35. IEnumerable<PluginDescriptor> GetPluginDescriptors(LoadPluginsMode loadMode = LoadPluginsMode.InstalledOnly,
  36. int storeId = 0, string group = null);
  37. /// <summary>
  38. /// Get plugin descriptors
  39. /// </summary>
  40. /// <typeparam name="T">The type of plugin to get.</typeparam>
  41. /// <param name="loadMode">Load plugins mode</param>
  42. /// <param name="storeId">Load records allowed only in a specified store; pass 0 to load all records</param>
  43. /// <param name="group">Filter by plugin group; pass null to load all records</param>
  44. /// <returns>Plugin descriptors</returns>
  45. IEnumerable<PluginDescriptor> GetPluginDescriptors<T>(LoadPluginsMode loadMode = LoadPluginsMode.InstalledOnly,
  46. int storeId = 0, string group = null) where T : class, IPlugin;
  47. /// <summary>
  48. /// Get a plugin descriptor by its system name
  49. /// </summary>
  50. /// <param name="systemName">Plugin system name</param>
  51. /// <param name="loadMode">Load plugins mode</param>
  52. /// <returns>>Plugin descriptor</returns>
  53. PluginDescriptor GetPluginDescriptorBySystemName(string systemName, LoadPluginsMode loadMode = LoadPluginsMode.InstalledOnly);
  54. /// <summary>
  55. /// Get a plugin descriptor by its system name
  56. /// </summary>
  57. /// <typeparam name="T">The type of plugin to get.</typeparam>
  58. /// <param name="systemName">Plugin system name</param>
  59. /// <param name="loadMode">Load plugins mode</param>
  60. /// <returns>>Plugin descriptor</returns>
  61. PluginDescriptor GetPluginDescriptorBySystemName<T>(string systemName, LoadPluginsMode loadMode = LoadPluginsMode.InstalledOnly)
  62. where T : class, IPlugin;
  63. /// <summary>
  64. /// Reload plugins
  65. /// </summary>
  66. void ReloadPlugins();
  67. }
  68. }