diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index 7d99c2ec34..d6b36bbb26 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -141,14 +141,10 @@ namespace Wox.Core.Plugin { var customizedPluginConfig = UserSettingStorage.Instance. CustomizedPluginConfigs.FirstOrDefault(o => o.ID == plugin.Metadata.ID); - if (customizedPluginConfig != null && customizedPluginConfig.Disabled) - { - return; - } + if (customizedPluginConfig != null && customizedPluginConfig.Disabled) return; if (query.IsIntantQuery && IsInstantSearchPlugin(plugin.Metadata)) { - Debug.WriteLine(string.Format("Plugin {0} is executing instant search.", plugin.Metadata.Name)); - using (new Timeit(" => instant search took: ")) + using (new Timeit($"Plugin {plugin.Metadata.Name} is executing instant search")) { QueryForPlugin(plugin, query); } @@ -190,16 +186,17 @@ namespace Wox.Core.Plugin /// private static bool IsVailldActionKeyword(string actionKeyword) { - if (string.IsNullOrEmpty(actionKeyword) || actionKeyword == Query.ActionKeywordWildcardSign) return false; + if (string.IsNullOrEmpty(actionKeyword) || actionKeyword == Query.WildcardSign) return false; PluginPair pair = AllPlugins.FirstOrDefault(o => o.Metadata.ActionKeyword == actionKeyword); if (pair == null) return false; - var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == pair.Metadata.ID); + var customizedPluginConfig = UserSettingStorage.Instance. + CustomizedPluginConfigs.FirstOrDefault(o => o.ID == pair.Metadata.ID); return customizedPluginConfig == null || !customizedPluginConfig.Disabled; } public static bool IsSystemPlugin(PluginMetadata metadata) { - return metadata.ActionKeyword == Query.ActionKeywordWildcardSign; + return metadata.ActionKeyword == Query.WildcardSign; } public static bool IsInstantQuery(string query) diff --git a/Wox.Infrastructure/Timeit.cs b/Wox.Infrastructure/Timeit.cs index 1e92cd8deb..6b6e0d704d 100644 --- a/Wox.Infrastructure/Timeit.cs +++ b/Wox.Infrastructure/Timeit.cs @@ -23,7 +23,7 @@ namespace Wox.Infrastructure _stopwatch.Stop(); long seconds = _stopwatch.ElapsedMilliseconds; _stopwatch.Start(); - Debug.WriteLine(_name + ":" + _stopwatch.ElapsedMilliseconds + "ms"); + Debug.WriteLine(_name + " : " + _stopwatch.ElapsedMilliseconds + "ms"); return seconds; } } diff --git a/Wox.Plugin/Query.cs b/Wox.Plugin/Query.cs index e4c6e0fa3a..538b23f9df 100644 --- a/Wox.Plugin/Query.cs +++ b/Wox.Plugin/Query.cs @@ -27,6 +27,11 @@ namespace Wox.Plugin public const string Seperater = " "; + /// + /// * is used for System Plugin + /// + public const string WildcardSign = "*"; + internal string ActionKeyword { get; set; } internal bool IsIntantQuery { get; set; } @@ -120,6 +125,6 @@ namespace Wox.Plugin return String.Empty; } - public const string ActionKeywordWildcardSign = "*"; + } } diff --git a/Wox/ActionKeyword.xaml.cs b/Wox/ActionKeyword.xaml.cs index 4bfe80e445..0e8b8e1382 100644 --- a/Wox/ActionKeyword.xaml.cs +++ b/Wox/ActionKeyword.xaml.cs @@ -45,7 +45,7 @@ namespace Wox } //check new action keyword didn't used by other plugin - if (tbAction.Text.Trim() != Query.ActionKeywordWildcardSign && PluginManager.AllPlugins.Exists(o => o.Metadata.ActionKeyword == tbAction.Text.Trim())) + if (tbAction.Text.Trim() != Query.WildcardSign && PluginManager.AllPlugins.Exists(o => o.Metadata.ActionKeyword == tbAction.Text.Trim())) { MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordHasBeenAssigned")); return;