diff --git a/Plugins/Wox.Plugin.CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs index b34f92f9cf..59c25ef60b 100644 --- a/Plugins/Wox.Plugin.CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -8,7 +8,6 @@ using WindowsInput; using WindowsInput.Native; using Wox.Infrastructure.Hotkey; using Wox.Infrastructure.Logger; -using Wox.Plugin.Features; using Control = System.Windows.Controls.Control; namespace Wox.Plugin.CMD diff --git a/Plugins/Wox.Plugin.Everything/Main.cs b/Plugins/Wox.Plugin.Everything/Main.cs index 5aec121eb6..1a6ed8c6bb 100644 --- a/Plugins/Wox.Plugin.Everything/Main.cs +++ b/Plugins/Wox.Plugin.Everything/Main.cs @@ -7,7 +7,6 @@ using System.Reflection; using System.ServiceProcess; using Wox.Infrastructure; using Wox.Plugin.Everything.Everything; -using Wox.Plugin.Features; namespace Wox.Plugin.Everything { diff --git a/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs b/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs index 559a06518d..4d258e74fc 100644 --- a/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs +++ b/Plugins/Wox.Plugin.Program/FileChangeWatcher.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.IO; using System.Threading; -using Wox.Infrastructure; namespace Wox.Plugin.Program { diff --git a/Plugins/Wox.Plugin.Program/Programs.cs b/Plugins/Wox.Plugin.Program/Programs.cs index 87b2aeeeed..8e2349e435 100644 --- a/Plugins/Wox.Plugin.Program/Programs.cs +++ b/Plugins/Wox.Plugin.Program/Programs.cs @@ -7,7 +7,6 @@ using System.Reflection; using System.Windows; using IWshRuntimeLibrary; using Wox.Infrastructure; -using Wox.Plugin.Features; using Wox.Plugin.Program.ProgramSources; namespace Wox.Plugin.Program diff --git a/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs index 7e85b12df3..4de81492e6 100644 --- a/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs +++ b/Plugins/Wox.Plugin.WebSearch/WebQueryPlugin.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; -using Wox.Plugin.Features; using Wox.Plugin.WebSearch.SuggestionSources; namespace Wox.Plugin.WebSearch diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index ec8aa7de1e..0dcad32796 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -12,7 +11,6 @@ using Wox.Core.UserSettings; using Wox.Infrastructure; using Wox.Infrastructure.Logger; using Wox.Plugin; -using Wox.Plugin.Features; namespace Wox.Core.Plugin { @@ -229,7 +227,7 @@ namespace Wox.Core.Plugin return AllPlugins.FirstOrDefault(o => o.Metadata.ID == id); } - public static IEnumerable GetPlugins() where T : class + public static IEnumerable GetPlugins() where T : IFeatures { return from p in AllPlugins where p.Plugin is T select p; } diff --git a/Wox.Core/UI/ResourceMerger.cs b/Wox.Core/UI/ResourceMerger.cs index 0e73a502ef..369eb0e46e 100644 --- a/Wox.Core/UI/ResourceMerger.cs +++ b/Wox.Core/UI/ResourceMerger.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Windows; using Wox.Core.i18n; using Wox.Core.Plugin; -using Wox.Infrastructure; using Wox.Plugin; namespace Wox.Core.UI diff --git a/Wox.Plugin/Feature.cs b/Wox.Plugin/Feature.cs new file mode 100644 index 0000000000..e12ef754ef --- /dev/null +++ b/Wox.Plugin/Feature.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; + +namespace Wox.Plugin +{ + public interface IFeatures { } + + public interface IContextMenu : IFeatures + { + List LoadContextMenus(Result selectedResult); + } + + public interface IExclusiveQuery : IFeatures + { + bool IsExclusiveQuery(Query query); + } + + /// + /// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface + /// This will improve the performance of instant search like websearch or cmd plugin + /// + public interface IInstantQuery : IFeatures + { + bool IsInstantQuery(string query); + } + + /// + /// Represent plugins that support internationalization + /// + public interface IPluginI18n : IFeatures + { + string GetLanguagesFolder(); + + string GetTranslatedPluginTitle(); + + string GetTranslatedPluginDescription(); + } +} diff --git a/Wox.Plugin/Features/IContextMenu.cs b/Wox.Plugin/Features/IContextMenu.cs index ce42446640..e6bfc927d2 100644 --- a/Wox.Plugin/Features/IContextMenu.cs +++ b/Wox.Plugin/Features/IContextMenu.cs @@ -1,9 +1,8 @@ -using System.Collections.Generic; - +using System; namespace Wox.Plugin.Features { - public interface IContextMenu - { - List LoadContextMenus(Result selectedResult); - } + [Obsolete("Delete Wox.Plugin.Features using directive, " + + "and use Wox.Plugin.Feature.IContextMenu instead, " + + "this method will be removed in v1.3.0")] + public interface IContextMenu { } } \ No newline at end of file diff --git a/Wox.Plugin/Features/IExclusiveQuery.cs b/Wox.Plugin/Features/IExclusiveQuery.cs index ad816e4bda..a433033505 100644 --- a/Wox.Plugin/Features/IExclusiveQuery.cs +++ b/Wox.Plugin/Features/IExclusiveQuery.cs @@ -1,7 +1,9 @@ -namespace Wox.Plugin.Features +using System; + +namespace Wox.Plugin.Features { - public interface IExclusiveQuery - { - bool IsExclusiveQuery(Query query); - } + [Obsolete("Delete Wox.Plugin.Features using directive, " + + "and use Wox.Plugin.Feature.IInstantQuery instead, " + + "this method will be removed in v1.3.0")] + public interface IExclusiveQuery { } } diff --git a/Wox.Plugin/Features/IInstantQuery.cs b/Wox.Plugin/Features/IInstantQuery.cs index 00044ed6c0..2fe81fad71 100644 --- a/Wox.Plugin/Features/IInstantQuery.cs +++ b/Wox.Plugin/Features/IInstantQuery.cs @@ -1,11 +1,9 @@ -namespace Wox.Plugin.Features +using System; + +namespace Wox.Plugin.Features { - /// - /// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface - /// This will improve the performance of instant search like websearch or cmd plugin - /// - public interface IInstantQuery - { - bool IsInstantQuery(string query); - } + [Obsolete("Delete Wox.Plugin.Features using directive, " + + "and use Wox.Plugin.Feature.IInstantQuery instead, " + + "this method will be removed in v1.3.0")] + public interface IInstantQuery { } } \ No newline at end of file diff --git a/Wox.Plugin/IPluginI18n.cs b/Wox.Plugin/IPluginI18n.cs deleted file mode 100644 index f0bdad2ff5..0000000000 --- a/Wox.Plugin/IPluginI18n.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Wox.Plugin -{ - /// - /// Represent plugins that support internationalization - /// - public interface IPluginI18n - { - string GetLanguagesFolder(); - - string GetTranslatedPluginTitle(); - - string GetTranslatedPluginDescription(); - } -} \ No newline at end of file diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index 7f75332bd9..11c1b4c89b 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -40,11 +40,11 @@ + - @@ -59,6 +59,7 @@ +