mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Remove LoadInterfacesFromAppDomain
Much faster. ApplyPluginLanguages is 10 times faster now. 7ms vs 100ms.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user