public void AddAssembliesToScan(IEnumerable <Assembly> assemblies) { foreach (var assembly in assemblies) { AssembliesToScan.Add(assembly); } }
public ICreateQuickMapsConfigurationOptions AddAssemblies(params Type[] assemblyTypeMarkers) { var assembliesToScan = assemblyTypeMarkers.Select(x => x.Assembly).ToArray(); AssembliesToScan = AssembliesToScan.Concat(assembliesToScan).Distinct().ToArray(); return(this); }
/// <summary> /// Updates the assembly cache from the appdomain /// </summary> private static void UpdateAssemblies() { assemblies = (from assembly in AppDomain.CurrentDomain.GetAssemblies() where AssembliesToScan.Any(asm => asm(assembly)) where !assembly.IsDynamic where !assembly.ReflectionOnly select assembly).ToArray(); }
/// <summary> /// Updates the assembly cache from the appdomain /// </summary> private static void UpdateAssemblies() { _assemblies = AppDomain.CurrentDomain.GetAssemblies() .Where(a => AssembliesToScan.Any(asm => asm(a)) && !a.IsDynamic && !a.ReflectionOnly) .Select(a => a) .ToArray(); _assemblies = _assemblies.DistinctBy(x => x.GetName().Name); }
public Configuration AddAssemblyToScan(params Assembly[] assemblies) { foreach (var assemblyToAdd in assemblies.Where(assemblyToAdd => AssembliesToScan.All(x => x.FullName != assemblyToAdd.FullName))) { AssembliesToScan.Add(assemblyToAdd); } return(this); }
public IAddRemotiatrOptions AddAssemblies(params Assembly[] assembliesToScan) { if (assembliesToScan == null) { throw new ArgumentNullException(nameof(assembliesToScan)); } AssembliesToScan = AssembliesToScan.Concat(assembliesToScan).Distinct().ToArray(); return(this); }
/// <summary> /// Add assemblies to the list of assemblies to scan for Nancy types /// </summary> /// <param name="assemblies">One of more assemblies</param> public static void AddAssembliesToScan(params Assembly[] assemblies) { foreach (var assembly in assemblies) { LoadAssemblies(assembly.GetName() + ".dll"); LoadAssemblies(assembly.GetName() + ".exe"); } var scanningPredicates = assemblies.Select(an => (Func <Assembly, bool>)(a => a == an)); AssembliesToScan = AssembliesToScan.Union(scanningPredicates); }
public IAddRemotiatrOptions AddAssemblies(params Type[] assemblyTypeMarkers) { if (assemblyTypeMarkers == null) { throw new ArgumentNullException(nameof(assemblyTypeMarkers)); } var assembliesToScan = assemblyTypeMarkers.Select(x => x.Assembly).ToArray(); AssembliesToScan = AssembliesToScan.Concat(assembliesToScan).Distinct().ToArray(); return(this); }
public static IEnumerable <IDependencyResolver> GetAllDependencyResolvers(TestHarnessTypeProvider typeProvider) { var dependencyResolvers = AssembliesToScan .SelectMany(a => a.GetExportedTypes()) .Where(t => typeof(IDependencyResolverFactory).IsAssignableFrom(t)) .Where(t => t.IsInstantiable()) .Select(Activator.CreateInstance) .Cast <IDependencyResolverFactory>() .Select(factory => factory.Create(typeProvider)) .ToArray(); return(dependencyResolvers); }
/// <summary> /// Add assemblies to the list of assemblies to scan for Nancy types /// </summary> /// <param name="assemblyNames">One or more assembly names</param> public static void AddAssembliesToScan(params string[] assemblyNames) { var normalisedNames = GetNormalisedAssemblyNames(assemblyNames).ToArray(); foreach (var assemblyName in normalisedNames) { LoadAssemblies(assemblyName + ".dll"); LoadAssemblies(assemblyName + ".exe"); } var scanningPredicates = normalisedNames.Select(s => { return((Func <Assembly, bool>)(a => a.GetName().Name == s)); }); AssembliesToScan = AssembliesToScan.Union(scanningPredicates); }
/// <summary> /// Add predicates for determining which assemblies to scan for Nancy types /// </summary> /// <param name="predicates">One or more predicates</param> public static void AddAssembliesToScan(params Func <Assembly, bool>[] predicates) { AssembliesToScan = AssembliesToScan.Union(predicates); }
public ICreateQuickMapsConfigurationOptions AddAssemblies(params Assembly[] assembliesToScan) { AssembliesToScan = AssembliesToScan.Concat(assembliesToScan).Distinct().ToArray(); return(this); }