Finding all classes within a namespace

  • Thread starter Thread starter TheNedMan
  • Start date Start date
T

TheNedMan

Is there a way to find all classes within a namespace
(programmatically)? I've played around with reflection a bit and it
seems that you can only find members of classes, not classes within a
namespace.

e.g., How would I find all classes within the namespace "System.Web"?

Any ideas?
 
Hi,
Is there a way to find all classes within a namespace
(programmatically)? I've played around with reflection a bit and it
seems that you can only find members of classes, not classes within a
namespace.

e.g., How would I find all classes within the namespace "System.Web"?

Since a namespace is only a "virtual" structure (which means that there is
no "Namespace"-Class, every class just knows her Namespace) you need to get
all the Types and check the "Namespace"-Property ...

Regards,

Frank Eller
www.frankeller.de
 
Frank Eller [MVP]wrote:
"]Hi,
Is there a way to find all classes within a namespace
(programmatically)? I've played around with reflection a bit and it
seems that you can only find members of classes, not classes within a
namespace.

e.g., How would I find all classes within the namespace "System.Web"?
Since a namespace is only a "virtual" structure (which means that
there is
no "Namespace"-Class, every class just knows her Namespace) you need
to get
all the Types and check the "Namespace"-Property ...

Regards,

Frank Eller
www.frankeller.de[/quote:da0876ead6]

Thanks, that makes sense now. How would I get all possible .NET
classes ? (in order to then query the namespace property)
 
Back
Top