From 4f5b2d35e8eb69aae37741a22e725b00d00e5135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Fri, 8 Jan 2021 16:08:39 +0800 Subject: [PATCH] Allow plugin to add & remove actionkeywords --- Flow.Launcher.Plugin/IPublicAPI.cs | 5 +++++ Flow.Launcher/PublicAPIInstance.cs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/Flow.Launcher.Plugin/IPublicAPI.cs b/Flow.Launcher.Plugin/IPublicAPI.cs index 4c89973ae..b28abbfcc 100644 --- a/Flow.Launcher.Plugin/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/IPublicAPI.cs @@ -95,5 +95,10 @@ namespace Flow.Launcher.Plugin Task 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); + } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 809a4b920..5c892c557 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -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