Can you enumerate all inherited classes?

  • Thread starter Thread starter jacques
  • Start date Start date
J

jacques

Hi all,

I've written a load of classes which inherit from another base class
which I've written. Is it possible to enumerate all the classes which
inherit from a particular base class? I'd like to dynamically produce
a list or collection of all these classes, so when I add another
dirved class or dll containing a dirved class which inheirts from my
base class it will appear in my list/collection.

Hope someone can help. any ideas?
 
Sorry I babbled a bit there!

In short, how can I get a list of types/classes which inherit from
another class?
 
(e-mail address removed) wrote in @p15g2000hsd.googlegroups.com:
Sorry I babbled a bit there!

In short, how can I get a list of types/classes which inherit from
another class?

System.Reflection.Assembly.GetTypes

http://msdn2.microsoft.com/en-
us/library/system.reflection.assembly.gettypes.aspx

From there you can loop through all the types in the class and check what
they inherit from or implement.
 
(e-mail address removed) wrote in @p15g2000hsd.googlegroups.com:



System.Reflection.Assembly.GetTypes

http://msdn2.microsoft.com/en-
us/library/system.reflection.assembly.gettypes.aspx

From there you can loop through all the types in the class and check what
they inherit from or implement.

I'll give this a go then... thanks
 
Back
Top