How can I get all classes inside a namespace?
You cannot. Classes are not "in" namespaces. Classes have namespaces as part of their name.
The classes "in" a namespace may reside in multiple assemblies. For example, some of the types in the System
namespace reside in mscorlib.dll, and others reside in System.dll. You would have to go through all of the types in all of the assemblies you could find to be certain that you had found all the types "in" a particular namespace.
As @hawk mentioned, the answer is located here, with sample code that you can use:
Getting all types in a namespace via reflection
Use Reflector to see them (assuming that all the classes are in the same assembly).
精彩评论