mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Refactoring Plugin.Feature
This commit is contained in:
37
Wox.Plugin/Feature.cs
Normal file
37
Wox.Plugin/Feature.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wox.Plugin
|
||||
{
|
||||
public interface IFeatures { }
|
||||
|
||||
public interface IContextMenu : IFeatures
|
||||
{
|
||||
List<Result> LoadContextMenus(Result selectedResult);
|
||||
}
|
||||
|
||||
public interface IExclusiveQuery : IFeatures
|
||||
{
|
||||
bool IsExclusiveQuery(Query query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface
|
||||
/// <remarks>This will improve the performance of instant search like websearch or cmd plugin</remarks>
|
||||
/// </summary>
|
||||
public interface IInstantQuery : IFeatures
|
||||
{
|
||||
bool IsInstantQuery(string query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represent plugins that support internationalization
|
||||
/// </summary>
|
||||
public interface IPluginI18n : IFeatures
|
||||
{
|
||||
string GetLanguagesFolder();
|
||||
|
||||
string GetTranslatedPluginTitle();
|
||||
|
||||
string GetTranslatedPluginDescription();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System;
|
||||
namespace Wox.Plugin.Features
|
||||
{
|
||||
public interface IContextMenu
|
||||
{
|
||||
List<Result> 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 { }
|
||||
}
|
||||
@@ -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 { }
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
namespace Wox.Plugin.Features
|
||||
using System;
|
||||
|
||||
namespace Wox.Plugin.Features
|
||||
{
|
||||
/// <summary>
|
||||
/// Represent plugin query will be executed in UI thread directly. Don't do long-running operation in Query method if you implement this interface
|
||||
/// <remarks>This will improve the performance of instant search like websearch or cmd plugin</remarks>
|
||||
/// </summary>
|
||||
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 { }
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Wox.Plugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Represent plugins that support internationalization
|
||||
/// </summary>
|
||||
public interface IPluginI18n
|
||||
{
|
||||
string GetLanguagesFolder();
|
||||
|
||||
string GetTranslatedPluginTitle();
|
||||
|
||||
string GetTranslatedPluginDescription();
|
||||
}
|
||||
}
|
||||
@@ -40,11 +40,11 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="AllowedLanguage.cs" />
|
||||
<Compile Include="EventHandler.cs" />
|
||||
<Compile Include="Feature.cs" />
|
||||
<Compile Include="Features\IContextMenu.cs" />
|
||||
<Compile Include="Features\IExclusiveQuery.cs" />
|
||||
<Compile Include="Features\IInstantQuery.cs" />
|
||||
<Compile Include="IHttpProxy.cs" />
|
||||
<Compile Include="IPluginI18n.cs" />
|
||||
<Compile Include="IPlugin.cs" />
|
||||
<Compile Include="IPublicAPI.cs" />
|
||||
<Compile Include="ISettingProvider.cs" />
|
||||
@@ -59,6 +59,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Reference in New Issue
Block a user