mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 11:17:53 +01:00
structure change
This commit is contained in:
@@ -2,15 +2,38 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using WinAlfred.Plugin;
|
||||
using WinAlfred.PluginLoader;
|
||||
|
||||
namespace WinAlfred.Commands
|
||||
{
|
||||
public class SystemCommand
|
||||
public class SystemCommand : BaseCommand
|
||||
{
|
||||
public void Dispatch(Query query)
|
||||
private List<PluginPair> systemPlugins;
|
||||
|
||||
public SystemCommand(MainWindow window)
|
||||
: base(window)
|
||||
{
|
||||
|
||||
systemPlugins = Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System).ToList();
|
||||
}
|
||||
|
||||
public override void Dispatch(Query query)
|
||||
{
|
||||
foreach (PluginPair pair in systemPlugins)
|
||||
{
|
||||
PluginPair pair1 = pair;
|
||||
ThreadPool.QueueUserWorkItem(state =>
|
||||
{
|
||||
List<Result> results = pair1.Plugin.Query(query);
|
||||
foreach (Result result in results)
|
||||
{
|
||||
result.PluginDirectory = pair1.Metadata.PluginDirecotry;
|
||||
result.OriginQuery = query;
|
||||
}
|
||||
UpdateResultView(results);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user