Horje
c# get classes which inherits Code Example
c# get classes which inherits
public static class ReflectiveEnumerator
{
    static ReflectiveEnumerator() { }

    public static IEnumerable<T> GetEnumerableOfType<T>(params object[] constructorArgs) where T : class, IComparable<T>
    {
        List<T> objects = new List<T>();
        foreach (Type type in 
            Assembly.GetAssembly(typeof(T)).GetTypes()
            .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T))))
        {
            objects.Add((T)Activator.CreateInstance(type, constructorArgs));
        }
        objects.Sort();
        return objects;
    }
}




Csharp

Related
List C# add from List Code Example List C# add from List Code Example
LINQ: 2 join with group by Code Example LINQ: 2 join with group by Code Example
remove header visual studio android Code Example remove header visual studio android Code Example
how to check type c# Code Example how to check type c# Code Example
trygetvalue dictionary c# example Code Example trygetvalue dictionary c# example Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
16