mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
structure change
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using WinAlfred.Plugin;
|
||||
|
||||
namespace WinAlfred.PluginLoader
|
||||
@@ -10,11 +11,24 @@ namespace WinAlfred.PluginLoader
|
||||
{
|
||||
private static List<PluginPair> plugins = new List<PluginPair>();
|
||||
|
||||
public static void Init()
|
||||
public static void Init(MainWindow window)
|
||||
{
|
||||
plugins.Clear();
|
||||
plugins.AddRange(new PythonPluginLoader().LoadPlugin());
|
||||
plugins.AddRange(new CSharpPluginLoader().LoadPlugin());
|
||||
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin))
|
||||
{
|
||||
IPlugin plugin1 = plugin;
|
||||
ThreadPool.QueueUserWorkItem(o => plugin1.Init(new PluginInitContext()
|
||||
{
|
||||
Plugins = plugins,
|
||||
ChangeQuery = s =>
|
||||
{
|
||||
window.tbQuery.Text = s;
|
||||
window.ShowWinAlfred();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public static List<PluginPair> AllPlugins
|
||||
|
||||
Reference in New Issue
Block a user