Allow plugin to add & remove actionkeywords

This commit is contained in:
弘韬 张 2021-01-08 16:08:39 +08:00
parent bd74a87d08
commit 4f5b2d35e8
2 changed files with 14 additions and 0 deletions

View file

@ -95,5 +95,10 @@ namespace Flow.Launcher.Plugin
Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = default);
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath);
void AddActionKeyword(string pluginId, string newActionKeyword);
void RemoveActionKeyword(string pluginId, string oldActionKeyword);
}
}

View file

@ -149,6 +149,15 @@ namespace Flow.Launcher
return Http.DownloadAsync(url, filePath);
}
public void AddActionKeyword(string pluginId, string newActionKeyword)
{
PluginManager.AddActionKeyword(pluginId, newActionKeyword);
}
public void RemoveActionKeyword(string pluginId, string oldActionKeyword)
{
PluginManager.RemoveActionKeyword(pluginId, oldActionKeyword);
}
#endregion
#region Private Methods