public static Type[] GetAllTypes(IEnumerable <Assembly> assemblies, TypeFindOptions options) { var result = new List <Type>(); foreach (var assembly in assemblies) { AddTypes(assembly, options, result); } return(result.ToArray()); }
private static void AddTypes(Assembly assembly, TypeFindOptions findOptions, List <Type> result) { var assemblyTypes = assembly.GetTypes(); result.AddRange(assemblyTypes.Where(findOptions.IsTargetType)); }