You can use the LINQ operator. I am not 100% sure what you are trying to do, but you can do something like this.
Assembly.GetTypes().Where(type => type.IsSubclassOf(SomeType) && type.Whatever);
Edit
If normal Assembly.GetTypes() does not return your nested class, you can CurrentType.GetNestedTypes() over the array and add everything you find in CurrentType.GetNestedTypes() to the array. as
var allTypes = new List<Type>(); var types = Assembly.GetTypes(); allTypes.AddRange(types); foreach(var type in types) { allTypes.AddRange(type.GetNestedTypes()); }
Stefan valianu
source share