Groups | Blog | Home
all groups > dotnet clr > july 2004 >

dotnet clr : Reflection to get objects that implement interface / or in namespa


Dinesh
7/21/2004 10:18:01 AM
Hello,

I wanted to know if it is possible to use reflection to get a list of all classes that implement a given interface. If not, is it possible to get a list of all classes that exist in a given namespace?

Thanks,

Jon Skeet [C# MVP]
7/21/2004 6:24:48 PM
[quoted text, click to view]

Use Assembly.GetTypes() to find all types in a particular assembly, and
use Type.IsAssignableFrom to check for type compatibility with a
particular type.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
AddThis Social Bookmark Button