System.ReflectionLibrary.GetSubclasses C# (CSharp) Method

GetSubclasses() public static method

public static GetSubclasses ( Type type, bool allowAbstract = false, bool allowSelf = true ) : IEnumerable
type Type
allowAbstract bool
allowSelf bool
return IEnumerable
        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;