mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
rename plugin main file, part 1
This commit is contained in:
47
Plugins/Wox.Plugin.PluginIndicator/Main.cs
Normal file
47
Plugins/Wox.Plugin.PluginIndicator/Main.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Core.UserSettings;
|
||||
|
||||
namespace Wox.Plugin.PluginIndicator
|
||||
{
|
||||
public class PluginIndicator : IPlugin, IPluginI18n
|
||||
{
|
||||
private PluginInitContext context;
|
||||
|
||||
public List<Result> Query(Query query)
|
||||
{
|
||||
var results = from keyword in PluginManager.NonGlobalPlugins.Keys
|
||||
where keyword.StartsWith(query.Terms[0])
|
||||
let metadata = PluginManager.NonGlobalPlugins[keyword].Metadata
|
||||
select new Result
|
||||
{
|
||||
Title = keyword,
|
||||
SubTitle = $"Activate {metadata.Name} plugin",
|
||||
Score = 100,
|
||||
IcoPath = metadata.IcoPath,
|
||||
Action = c =>
|
||||
{
|
||||
context.API.ChangeQuery($"{keyword}{Plugin.Query.TermSeperater}");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
return results.ToList();
|
||||
}
|
||||
|
||||
public void Init(PluginInitContext context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public string GetTranslatedPluginTitle()
|
||||
{
|
||||
return context.API.GetTranslation("wox_plugin_pluginindicator_plugin_name");
|
||||
}
|
||||
|
||||
public string GetTranslatedPluginDescription()
|
||||
{
|
||||
return context.API.GetTranslation("wox_plugin_pluginindicator_plugin_description");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user