public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly)
{
///////////////////////////////////////////////////
// This extension method was written by Jon Skeet.
// http://stackoverflow.com/a/7889272/936
///////////////////////////////////////////////////
if(assembly == null)
{
throw new ArgumentNullException("assembly");
}
try
{
return assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
return e.Types.Where(t => t != null);
}
}