/// <summary> /// Discovers the types. /// </summary> protected void DiscoverTypes() { FailedAssemblies.Clear(); var assemblies = GetComposablePartAssemblies().ToList(); foreach (var assembly in assemblies) { Logger.Info("Loading {0}", assembly.FullName); } AllConcreteTypes = assemblies .SelectMany(GetTypes) .Where(t => { #if NET46 return(t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType); #endif #if NETSTANDARD1_6 var typeInfo = t.GetTypeInfo(); return(typeInfo.IsClass && !typeInfo.IsAbstract && !typeInfo.IsInterface && !typeInfo.IsGenericType); #endif return(false); }) .ToArray(); }
/// <summary> /// Discovers the types. /// </summary> protected void DiscoverTypes() { FailedAssemblies.Clear(); var assemblies = GetComposablePartAssemblies().ToList(); foreach (var assembly in assemblies) { Logger.Info("Loading {0}", assembly.FullName); } AllTypes = assemblies.SelectMany(GetTypes).ToArray(); AllConcreteTypes = AllTypes.Where(t => t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType).ToArray(); }