I need to retrieve all enums that were loaded from a given set of Assemblies.
List<Type> list = new List<Type>();
foreach (Assembly ass in AppDomain.CurrentDomain.GetAssemblies())
{
foreach (Type t in ass.GetExportedTypes())
{
if (t.IsEnum)
{
list.Add(t);
}
}
}
That should do, for all assemblies loaded by the current AppDomain
; to get just from defined assemblies, just adjust ;-)