
Wednesday, March 26, 2008
Find the compatible types in an assembly:
public static Type[] FindCompatibleTypes(Assembly assembly, Type baseType)
{
List<Type> types = new List<Type>();
foreach (Type type in assembly.GetTypes())
{
if (type != baseType && baseType.IsAssignableFrom(type))
types.Add(type);
}
return types.ToArray();
}
© Copyright 2008 Chris Weber
Theme design by
Bryan Bell
newtelligence dasBlog 1.9.6264.0

| Page rendered at Friday, July 04, 2008 6:24:51 AM (Central Standard Time, UTC-06:00)