public static IEnumerable<Type> GetSubclasses(this Type type,
bool allowAbstract = false, bool allowSelf = true)
=>
from assembly in AppDomain.CurrentDomain.GetAssemblies()
from t in assembly.GetTypes()
where type.IsAssignableFrom(t)
&& (allowAbstract || (!t.IsAbstract && !t.IsInterface))
&& (allowSelf || t != type)
select t;