diff --git a/Plugins/Wox.Plugin.CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs index cd522d56af..da5877c67f 100644 --- a/Plugins/Wox.Plugin.CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -14,7 +14,7 @@ using Control = System.Windows.Controls.Control; namespace Wox.Plugin.CMD { - public class CMD : IPlugin, ISettingProvider, IPluginI18n, IInstantSearch,IExclusiveSearch + public class CMD : IPlugin, ISettingProvider, IPluginI18n, IInstantQuery, IExclusiveQuery { private PluginInitContext context; private bool WinRStroked; @@ -213,13 +213,13 @@ namespace Wox.Plugin.CMD return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages"); } - public bool IsInstantSearch(string query) + public bool IsInstantQuery(string query) { if (query.StartsWith(">")) return true; return false; } - public bool IsExclusiveSearch(Query query) + public bool IsExclusiveQuery(Query query) { return query.Search.StartsWith(">"); } diff --git a/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs b/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs index 6454013391..0a46198260 100644 --- a/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs +++ b/Plugins/Wox.Plugin.PluginIndicator/PluginIndicator.cs @@ -15,7 +15,7 @@ namespace Wox.Plugin.PluginIndicator List results = new List(); if (allPlugins.Count == 0) { - allPlugins = context.API.GetAllPlugins().Where(o => !PluginManager.IsSystemPlugin(o.Metadata)).ToList(); + allPlugins = context.API.GetAllPlugins().Where(o => !PluginManager.IsGenericPlugin(o.Metadata)).ToList(); } foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata)) @@ -45,19 +45,6 @@ namespace Wox.Plugin.PluginIndicator } } - //results.AddRange(UserSettingStorage.Instance.WebSearches.Where(o => o.ActionWord.StartsWith(query.Search) && o.Enabled).Select(n => new Result() - //{ - // Title = n.ActionWord, - // SubTitle = string.Format("Activate {0} web search", n.ActionWord), - // Score = 100, - // IcoPath = "Images/work.png", - // Action = (c) => - // { - // context.API.ChangeQuery(n.ActionWord + " "); - // return false; - // } - //})); - return results; } diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs similarity index 88% rename from Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs rename to Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs index 8a2a43011d..41636b24f6 100644 --- a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs +++ b/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs @@ -5,11 +5,12 @@ using System.IO; using System.Linq; using System.Reflection; using Wox.Core.UserSettings; +using Wox.Plugin.Features; using Wox.Plugin.WebSearch.SuggestionSources; namespace Wox.Plugin.WebSearch { - public class WebSearchPlugin : IPlugin, ISettingProvider, IPluginI18n, IInstantSearch + public class WebQueryPlugin : IPlugin, ISettingProvider, IPluginI18n, IInstantQuery, IExclusiveQuery { private PluginInitContext context; @@ -18,7 +19,7 @@ namespace Wox.Plugin.WebSearch List results = new List(); WebSearch webSearch = - WebSearchStorage.Instance.WebSearches.FirstOrDefault(o => o.ActionWord == query.FirstSearch.Trim() && o.Enabled); + WebSearchStorage.Instance.WebSearches.FirstOrDefault(o => o.ActionWord == query.FirstSearch.Trim() && !string.IsNullOrEmpty(query.SecondSearch) && o.Enabled); if (webSearch != null) { @@ -98,15 +99,19 @@ namespace Wox.Plugin.WebSearch return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages"); } - public bool IsInstantSearch(string query) + public bool IsInstantQuery(string query) { var strings = query.Split(' '); if (strings.Length > 1) { - return WebSearchStorage.Instance.EnableWebSearchSuggestion && - WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == strings[0] && o.Enabled); + return WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == strings[0] && o.Enabled); } return false; } + + public bool IsExclusiveQuery(Query query) + { + return IsInstantQuery(query.RawQuery); + } } } diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj index 8c84b7b919..3f9a500eb1 100644 --- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj +++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj @@ -1,147 +1,147 @@ - - - - - Debug - AnyCPU - {403B57F2-1856-4FC7-8A24-36AB346B763E} - Library - Properties - Wox.Plugin.WebSearch - Wox.Plugin.WebSearch - v3.5 - 512 - ..\..\ - true - - - - true - full - false - ..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - ..\..\Output\Release\Plugins\Wox.Plugin.WebSearch\ - TRACE - prompt - 4 - false - - - - False - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - WebSearchesSetting.xaml - - - - WebSearchSetting.xaml - - - - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - PreserveNewest - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - - - {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} - Wox.Core - - - {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} - Wox.Infrastructure - - - {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} - Wox.Plugin - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - - - 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - + + + + + Debug + AnyCPU + {403B57F2-1856-4FC7-8A24-36AB346B763E} + Library + Properties + Wox.Plugin.WebSearch + Wox.Plugin.WebSearch + v3.5 + 512 + ..\..\ + true + + + + true + full + false + ..\..\Output\Debug\Plugins\Wox.Plugin.WebSearch\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + ..\..\Output\Release\Plugins\Wox.Plugin.WebSearch\ + TRACE + prompt + 4 + false + + + + False + ..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + WebSearchesSetting.xaml + + + + WebSearchSetting.xaml + + + + + + MSBuild:Compile + Designer + PreserveNewest + + + MSBuild:Compile + Designer + PreserveNewest + + + MSBuild:Compile + Designer + PreserveNewest + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + + + + {B749F0DB-8E75-47DB-9E5E-265D16D0C0D2} + Wox.Core + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + --> \ No newline at end of file diff --git a/Wox.Core/Plugin/PluginConfig.cs b/Wox.Core/Plugin/PluginConfig.cs index 6c96ef7773..f47e1dac01 100644 --- a/Wox.Core/Plugin/PluginConfig.cs +++ b/Wox.Core/Plugin/PluginConfig.cs @@ -78,7 +78,6 @@ namespace Wox.Core.Plugin try { metadata = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); - metadata.PluginType = PluginType.User; metadata.PluginDirectory = pluginDirectory; } catch (System.Exception) diff --git a/Wox.Core/Plugin/PluginInstaller.cs b/Wox.Core/Plugin/PluginInstaller.cs index df9939aaf5..77577aa9b1 100644 --- a/Wox.Core/Plugin/PluginInstaller.cs +++ b/Wox.Core/Plugin/PluginInstaller.cs @@ -112,7 +112,6 @@ namespace Wox.Core.Plugin try { metadata = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); - metadata.PluginType = PluginType.User; metadata.PluginDirectory = pluginDirectory; } catch (System.Exception) diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index 9cf930c783..fb13b57814 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -23,8 +23,8 @@ namespace Wox.Core.Plugin { public const string ActionKeywordWildcardSign = "*"; private static List pluginMetadatas; - private static List> instantSearches; - private static List> exclusiveSearchPlugins; + private static List> instantSearches; + private static List> exclusiveSearchPlugins; public static String DebuggerMode { get; private set; } public static IPublicAPI API { get; private set; } @@ -117,7 +117,7 @@ namespace Wox.Core.Plugin { if (!string.IsNullOrEmpty(query.RawQuery.Trim())) { - query.Search = IsUserPluginQuery(query) ? query.RawQuery.Substring(query.RawQuery.IndexOf(' ') + 1) : query.RawQuery; + query.Search = IsActionKeywordQuery(query) ? query.RawQuery.Substring(query.RawQuery.IndexOf(' ') + 1) : query.RawQuery; QueryDispatcher.QueryDispatcher.Dispatch(query); } } @@ -130,7 +130,12 @@ namespace Wox.Core.Plugin } } - public static bool IsUserPluginQuery(Query query) + /// + /// Check if a query contains action keyword + /// + /// + /// + public static bool IsActionKeywordQuery(Query query) { if (string.IsNullOrEmpty(query.RawQuery)) return false; var strings = query.RawQuery.Split(' '); @@ -139,10 +144,10 @@ namespace Wox.Core.Plugin var actionKeyword = strings[0].Trim(); if (string.IsNullOrEmpty(actionKeyword)) return false; - return plugins.Any(o => o.Metadata.PluginType == PluginType.User && o.Metadata.ActionKeyword == actionKeyword); + return plugins.Any(o => o.Metadata.ActionKeyword == actionKeyword); } - public static bool IsSystemPlugin(PluginMetadata metadata) + public static bool IsGenericPlugin(PluginMetadata metadata) { return metadata.ActionKeyword == ActionKeywordWildcardSign; } @@ -152,9 +157,9 @@ namespace Wox.Core.Plugin DebuggerMode = path; } - public static bool IsInstantSearch(string query) + public static bool IsInstantQuery(string query) { - return LoadInstantSearches().Any(o => o.Value.IsInstantSearch(query)); + return LoadInstantSearches().Any(o => o.Value.IsInstantQuery(query)); } public static bool IsInstantSearchPlugin(PluginMetadata pluginMetadata) @@ -194,11 +199,11 @@ namespace Wox.Core.Plugin } } - private static List> LoadInstantSearches() + private static List> LoadInstantSearches() { if (instantSearches != null) return instantSearches; - instantSearches = new List>(); + instantSearches = new List>(); List CSharpPluginMetadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.CSharp.ToUpper()).ToList(); foreach (PluginMetadata metadata in CSharpPluginMetadatas) @@ -206,7 +211,7 @@ namespace Wox.Core.Plugin try { Assembly asm = Assembly.Load(AssemblyName.GetAssemblyName(metadata.ExecuteFilePath)); - List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IInstantSearch))).ToList(); + List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IInstantQuery))).ToList(); if (types.Count == 0) { continue; @@ -214,7 +219,7 @@ namespace Wox.Core.Plugin foreach (Type type in types) { - instantSearches.Add(new KeyValuePair(metadata, Activator.CreateInstance(type) as IInstantSearch)); + instantSearches.Add(new KeyValuePair(metadata, Activator.CreateInstance(type) as IInstantQuery)); } } catch (System.Exception e) @@ -241,11 +246,11 @@ namespace Wox.Core.Plugin return AllPlugins.FirstOrDefault(o => o.Metadata.ID == id); } - internal static List> LoadExclusiveSearchPlugins() + internal static List> LoadExclusiveSearchPlugins() { if (exclusiveSearchPlugins != null) return exclusiveSearchPlugins; - exclusiveSearchPlugins = new List>(); + exclusiveSearchPlugins = new List>(); List CSharpPluginMetadatas = pluginMetadatas.Where(o => o.Language.ToUpper() == AllowedLanguage.CSharp.ToUpper()).ToList(); foreach (PluginMetadata metadata in CSharpPluginMetadatas) @@ -253,7 +258,7 @@ namespace Wox.Core.Plugin try { Assembly asm = Assembly.Load(AssemblyName.GetAssemblyName(metadata.ExecuteFilePath)); - List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IExclusiveSearch))).ToList(); + List types = asm.GetTypes().Where(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IExclusiveQuery))).ToList(); if (types.Count == 0) { continue; @@ -261,8 +266,8 @@ namespace Wox.Core.Plugin foreach (Type type in types) { - exclusiveSearchPlugins.Add(new KeyValuePair(AllPlugins.First(o => o.Metadata.ID == metadata.ID), - Activator.CreateInstance(type) as IExclusiveSearch)); + exclusiveSearchPlugins.Add(new KeyValuePair(AllPlugins.First(o => o.Metadata.ID == metadata.ID), + Activator.CreateInstance(type) as IExclusiveQuery)); } } catch (System.Exception e) @@ -279,12 +284,31 @@ namespace Wox.Core.Plugin return exclusiveSearchPlugins; } - internal static PluginPair GetExclusiveSearchPlugin(Query query) + internal static PluginPair GetExclusivePlugin(Query query) { - KeyValuePair plugin = LoadExclusiveSearchPlugins().FirstOrDefault(o => o.Value.IsExclusiveSearch((query))); - if (plugin.Key != null) return plugin.Key; + KeyValuePair plugin = LoadExclusiveSearchPlugins().FirstOrDefault(o => o.Value.IsExclusiveQuery((query))); + return plugin.Key; + } + + internal static PluginPair GetActionKeywordPlugin(Query query) + { + PluginPair exclusivePluginPair = AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == query.GetActionKeyword()); + if (exclusivePluginPair != null) + { + var customizedPluginConfig = UserSettingStorage.Instance. + CustomizedPluginConfigs.FirstOrDefault(o => o.ID == exclusivePluginPair.Metadata.ID); + if (customizedPluginConfig != null && !customizedPluginConfig.Disabled) + { + return exclusivePluginPair; + } + } return null; } + + internal static bool IsExclusivePluginQuery(Query query) + { + return GetExclusivePlugin(query) != null || GetActionKeywordPlugin(query) != null; + } } } diff --git a/Wox.Core/Plugin/QueryDispatcher/ExclusiveQueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/ExclusiveQueryDispatcher.cs new file mode 100644 index 0000000000..d0923c34c1 --- /dev/null +++ b/Wox.Core/Plugin/QueryDispatcher/ExclusiveQueryDispatcher.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using Wox.Core.Exception; +using Wox.Core.UserSettings; +using Wox.Infrastructure.Logger; +using Wox.Plugin; + +namespace Wox.Core.Plugin.QueryDispatcher +{ + public class ExclusiveQueryDispatcher : BaseQueryDispatcher + { + protected override List GetPlugins(Query query) + { + List pluginPairs = new List(); + var exclusivePluginPair = PluginManager.GetExclusivePlugin(query) ?? + PluginManager.GetActionKeywordPlugin(query); + if (exclusivePluginPair != null) + { + pluginPairs.Add(exclusivePluginPair); + } + + return pluginPairs; + } + + + + } +} diff --git a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/GenericQueryDispatcher.cs similarity index 55% rename from Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs rename to Wox.Core/Plugin/QueryDispatcher/GenericQueryDispatcher.cs index 9a9948df01..5c53c556b8 100644 --- a/Wox.Core/Plugin/QueryDispatcher/SystemPluginQueryDispatcher.cs +++ b/Wox.Core/Plugin/QueryDispatcher/GenericQueryDispatcher.cs @@ -8,14 +8,11 @@ using Wox.Plugin; namespace Wox.Core.Plugin.QueryDispatcher { - public class SystemPluginQueryDispatcher : BaseQueryDispatcher + public class GenericQueryDispatcher : BaseQueryDispatcher { - private readonly List allSytemPlugins = - PluginManager.AllPlugins.Where(o => PluginManager.IsSystemPlugin(o.Metadata)).ToList(); - protected override List GetPlugins(Query query) { - return allSytemPlugins; + return PluginManager.AllPlugins.Where(o => PluginManager.IsGenericPlugin(o.Metadata)).ToList(); } } } \ No newline at end of file diff --git a/Wox.Core/Plugin/QueryDispatcher/QueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/QueryDispatcher.cs index 3b4a4af556..5d2062b48e 100644 --- a/Wox.Core/Plugin/QueryDispatcher/QueryDispatcher.cs +++ b/Wox.Core/Plugin/QueryDispatcher/QueryDispatcher.cs @@ -6,28 +6,18 @@ namespace Wox.Core.Plugin.QueryDispatcher { internal static class QueryDispatcher { - private static readonly IQueryDispatcher UserPluginDispatcher = new UserPluginQueryDispatcher(); - private static readonly IQueryDispatcher SystemPluginDispatcher = new SystemPluginQueryDispatcher(); + private static readonly IQueryDispatcher exclusivePluginDispatcher = new ExclusiveQueryDispatcher(); + private static readonly IQueryDispatcher genericQueryDispatcher = new GenericQueryDispatcher(); - public static void Dispatch(Wox.Plugin.Query query) + public static void Dispatch(Query query) { - PluginPair exclusiveSearchPlugin = PluginManager.GetExclusiveSearchPlugin(query); - if (exclusiveSearchPlugin != null) + if (PluginManager.IsExclusivePluginQuery(query)) { - ThreadPool.QueueUserWorkItem(state => - { - PluginManager.ExecutePluginQuery(exclusiveSearchPlugin, query); - }); - return; - } - - if (PluginManager.IsUserPluginQuery(query)) - { - UserPluginDispatcher.Dispatch(query); + exclusivePluginDispatcher.Dispatch(query); } else { - SystemPluginDispatcher.Dispatch(query); + genericQueryDispatcher.Dispatch(query); } } } diff --git a/Wox.Core/Plugin/QueryDispatcher/UserPluginQueryDispatcher.cs b/Wox.Core/Plugin/QueryDispatcher/UserPluginQueryDispatcher.cs deleted file mode 100644 index d3cebb88d0..0000000000 --- a/Wox.Core/Plugin/QueryDispatcher/UserPluginQueryDispatcher.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using Wox.Core.Exception; -using Wox.Core.UserSettings; -using Wox.Infrastructure.Logger; -using Wox.Plugin; - -namespace Wox.Core.Plugin.QueryDispatcher -{ - public class UserPluginQueryDispatcher : BaseQueryDispatcher - { - protected override List GetPlugins(Query query) - { - List plugins = new List(); - //only first plugin that matches action keyword will get executed - PluginPair userPlugin = PluginManager.AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == query.GetActionKeyword()); - if (userPlugin != null) - { - var customizedPluginConfig = UserSettingStorage.Instance. - CustomizedPluginConfigs.FirstOrDefault(o => o.ID == userPlugin.Metadata.ID); - if (customizedPluginConfig != null && customizedPluginConfig.Disabled) - { - //need to stop the loading animation - PluginManager.API.StopLoadingBar(); - } - else - { - plugins.Add(userPlugin); - } - } - - return plugins; - } - } -} diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index 92c63ae13c..9fc73a2c9a 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -86,8 +86,8 @@ - - + + diff --git a/Wox.Infrastructure/DebugHelper.cs b/Wox.Infrastructure/DebugHelper.cs index 5d5e111423..e31636b7e1 100644 --- a/Wox.Infrastructure/DebugHelper.cs +++ b/Wox.Infrastructure/DebugHelper.cs @@ -10,6 +10,7 @@ namespace Wox.Infrastructure { public static void WriteLine(string msg) { + return; Debug.WriteLine(msg); } } diff --git a/Wox.Plugin/Features/IExclusiveSearch.cs b/Wox.Plugin/Features/IExclusiveQuery.cs similarity index 62% rename from Wox.Plugin/Features/IExclusiveSearch.cs rename to Wox.Plugin/Features/IExclusiveQuery.cs index 0339b5094a..6c6acbf5e0 100644 --- a/Wox.Plugin/Features/IExclusiveSearch.cs +++ b/Wox.Plugin/Features/IExclusiveQuery.cs @@ -5,8 +5,8 @@ using System.Text; namespace Wox.Plugin.Features { - public interface IExclusiveSearch + public interface IExclusiveQuery { - bool IsExclusiveSearch(Query query); + bool IsExclusiveQuery(Query query); } } diff --git a/Wox.Plugin/Features/IInstantQuery.cs b/Wox.Plugin/Features/IInstantQuery.cs new file mode 100644 index 0000000000..154f167e23 --- /dev/null +++ b/Wox.Plugin/Features/IInstantQuery.cs @@ -0,0 +1,7 @@ +namespace Wox.Plugin.Features +{ + public interface IInstantQuery + { + bool IsInstantQuery(string query); + } +} \ No newline at end of file diff --git a/Wox.Plugin/IInstantSearch.cs b/Wox.Plugin/IInstantSearch.cs deleted file mode 100644 index 553c6573b4..0000000000 --- a/Wox.Plugin/IInstantSearch.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Wox.Plugin.Features; - -namespace Wox.Plugin -{ - public interface IInstantSearch - { - bool IsInstantSearch(string query); - } -} diff --git a/Wox.Plugin/PluginMetadata.cs b/Wox.Plugin/PluginMetadata.cs index 406257f869..48e6c024f7 100644 --- a/Wox.Plugin/PluginMetadata.cs +++ b/Wox.Plugin/PluginMetadata.cs @@ -24,10 +24,10 @@ namespace Wox.Plugin } public string ExecuteFileName { get; set; } + public string PluginDirectory { get; set; } public string ActionKeyword { get; set; } - public PluginType PluginType { get; set; } public string IcoPath { get; set; } diff --git a/Wox.Plugin/PluginType.cs b/Wox.Plugin/PluginType.cs deleted file mode 100644 index b8ffc6e124..0000000000 --- a/Wox.Plugin/PluginType.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Wox.Plugin -{ - public enum PluginType - { - System, - User - } -} \ No newline at end of file diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index 665f70ff37..80f2a52a48 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -46,8 +46,8 @@ - - + + @@ -56,7 +56,6 @@ - diff --git a/Wox.Test/QueryTest.cs b/Wox.Test/QueryTest.cs index 061e7d59f6..03c766d5c7 100644 --- a/Wox.Test/QueryTest.cs +++ b/Wox.Test/QueryTest.cs @@ -11,7 +11,7 @@ namespace Wox.Test public class QueryTest { [Test] - public void UserPluginQueryTest() + public void ExclusivePluginQueryTest() { Query q = new Query("f file.txt file2 file3"); q.Search = "file.txt file2 file3"; @@ -23,7 +23,7 @@ namespace Wox.Test } [Test] - public void SystemPluginQueryTest() + public void GenericPluginQueryTest() { Query q = new Query("file.txt file2 file3"); q.Search = q.RawQuery; diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 95a6e81bbf..ac5469e334 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -416,7 +416,7 @@ namespace Wox private int GetSearchDelay(string query) { - if (!string.IsNullOrEmpty(query) && PluginManager.IsInstantSearch(query)) + if (!string.IsNullOrEmpty(query) && PluginManager.IsInstantQuery(query)) { DebugHelper.WriteLine("execute query without delay"); return 0;