-
Notifications
You must be signed in to change notification settings - Fork 24
/
IPluginApi.cs
31 lines (29 loc) · 1.15 KB
/
IPluginApi.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
namespace SiteServer.Plugin
{
/// <summary>
/// 插件Api接口。
/// </summary>
public interface IPluginApi
{
/// <summary>
/// 获取当前插件文件夹下的目录/文件路径。
/// </summary>
/// <param name="pluginId">插件Id。</param>
/// <param name="relatedPath">相对路径。</param>
/// <returns>当前插件文件夹下的目录/文件绝对路径。</returns>
string GetPluginPath(string pluginId, string relatedPath = "");
/// <summary>
/// 获取当前插件文件夹下的目录/文件访问Url地址。
/// </summary>
/// <param name="pluginId">插件Id。</param>
/// <param name="relatedUrl">相对地址。</param>
/// <returns>当前插件文件夹下的目录/文件访问Url地址。</returns>
string GetPluginUrl(string pluginId, string relatedUrl = "");
/// <summary>
/// 通过插件Id获取插件实例。
/// </summary>
/// <typeparam name="T">插件类。</typeparam>
/// <returns>插件实例。</returns>
T GetPlugin<T>() where T : PluginBase;
}
}