private static Dictionary<Assembly, HashSet<Type>> GetAssemblyTypes(List<Assembly> assemblies)
{
// Multithreaded invocation
var types = (from assembly in assemblies
select new KeyValuePair<Assembly, HashSet<Type>>(assembly, new HashSet<Type>(assembly.GetAllTypesSafely())));
#if SILVERLIGHT || PCL
var results = types;
#else
var results = types.AsParallel();
#endif
return results.ToDictionary(p => p.Key, p => p.Value);
}