I am trying to create a list of sub classes for each class represented in my exported Types list. To be honest I am not sure how to do this, so my coding is mostly try and test.
Here is my list of classes.
public static Assembly asm = Assembly.LoadFrom(val);
List<Type> classes = asm.GetExportedTypes().Where(t => t.IsClass).ToList();
Here is my Foreach iteration where I try to attempt to find a list of Children of current class.
foreach (Type type in classes)
{
List<Type> subclasses = asm.GetExportedTypes().Where(p => p.IsSubclassOf(type)).ToList();
}
I don't know if this is adding to my confusion but my assembly with all the information is excluded from my project, the main idea for my project is to find all inheritance trees for each class.
Basically my Question is how to iterate through each class and find all children that inherits from the current class.
Aucun commentaire:
Enregistrer un commentaire