Refactoring LoadPluginInterfaces

This commit is contained in:
bao-qian
2015-11-02 18:13:53 +00:00
parent c9edc217fd
commit a668ed5e24
2 changed files with 37 additions and 42 deletions

View File

@@ -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;
}
}
}