Remove LoadInterfacesFromAppDomain

Much faster. ApplyPluginLanguages is 10 times faster now. 7ms vs 100ms.
This commit is contained in:
bao-qian
2015-11-02 13:42:52 +00:00
parent 881e414043
commit 96b6832dff
4 changed files with 13 additions and 35 deletions

View File

@@ -23,14 +23,5 @@ namespace Wox.Core
}
return results;
}
public static List<T> LoadInterfacesFromAppDomain<T>() where T : class
{
var interfaceObjects = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(p => p.IsClass && !p.IsAbstract && p.GetInterfaces().Contains(typeof(T)));
return interfaceObjects.Select(interfaceObject => (T) Activator.CreateInstance(interfaceObject)).ToList();
}
}
}