mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Refactoring LoadPluginInterfaces
This commit is contained in:
@@ -8,20 +8,5 @@ namespace Wox.Core
|
||||
{
|
||||
internal class AssemblyHelper
|
||||
{
|
||||
public static List<KeyValuePair<PluginPair, T>> LoadPluginInterfaces<T>() where T : class
|
||||
{
|
||||
List<KeyValuePair<PluginPair, T>> results = new List<KeyValuePair<PluginPair, T>>();
|
||||
foreach (PluginPair pluginPair in PluginManager.AllPlugins)
|
||||
{
|
||||
//need to load types from AllPlugins
|
||||
//PluginInitContext is only available in this instance
|
||||
T type = pluginPair.Plugin as T;
|
||||
if (type != null)
|
||||
{
|
||||
results.Add(new KeyValuePair<PluginPair, T>(pluginPair,type));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user