/// <summary> /// Initializes a new instance of the <see cref="ReportBuilder"/> class. /// </summary> /// <param name="parser">The IParser to use.</param> /// <param name="rendererFactory">The renderer factory.</param> /// <param name="targetDirectory">The directory where the generated report should be saved.</param> /// <param name="assemblyFilter">The assembly filter.</param> public ReportBuilder(IParser parser, IRendererFactory rendererFactory, string targetDirectory, IAssemblyFilter assemblyFilter) { if (parser == null) { throw new ArgumentNullException("parser"); } if (rendererFactory == null) { throw new ArgumentNullException("rendererFactory"); } if (targetDirectory == null) { throw new ArgumentNullException("targetDirectory"); } if (assemblyFilter == null) { throw new ArgumentNullException("assemblyFilter"); } this.parser = parser; this.rendererFactory = rendererFactory; this.targetDirectory = targetDirectory; this.assemblyFilter = assemblyFilter; }
/// <summary> /// Initializes a new instance of the <see cref="ReportBuilder"/> class. /// </summary> /// <param name="parser">The IParser to use.</param> /// <param name="rendererFactory">The renderer factory.</param> /// <param name="targetDirectory">The directory where the generated report should be saved.</param> /// <param name="assemblyFilter">The assembly filter.</param> public ReportBuilder(IParser parser, IRendererFactory rendererFactory, string targetDirectory, IAssemblyFilter assemblyFilter) { if (parser == null) { throw new ArgumentNullException("parser"); } if (rendererFactory == null) { throw new ArgumentNullException("rendererFactory"); } if (targetDirectory == null) { throw new ArgumentNullException("targetDirectory"); } if (assemblyFilter == null) { throw new ArgumentNullException("assemblyFilter"); } this.parser = parser; this.rendererFactory = rendererFactory; this.targetDirectory = targetDirectory; this.assemblyFilter = assemblyFilter; }
/// <summary> /// Initializes a new instance of the <see cref="ReportGenerator" /> class. /// </summary> /// <param name="parser">The IParser to use.</param> /// <param name="assemblyFilter">The assembly filter.</param> /// <param name="classFilter">The class filter.</param> /// <param name="renderers">The renderers.</param> internal ReportGenerator(IParser parser, IAssemblyFilter assemblyFilter, IClassFilter classFilter, IEnumerable<IReportBuilder> renderers) { if (parser == null) { throw new ArgumentNullException("parser"); } if (assemblyFilter == null) { throw new ArgumentNullException("assemblyFilter"); } if (classFilter == null) { throw new ArgumentNullException("classFilter"); } if (renderers == null) { throw new ArgumentNullException("renderers"); } this.parser = parser; this.assemblyFilter = assemblyFilter; this.classFilter = classFilter; this.renderers = renderers; }
/// <summary> /// Initializes a new instance of the <see cref="ReportGenerator" /> class. /// </summary> /// <param name="parser">The IParser to use.</param> /// <param name="assemblyFilter">The assembly filter.</param> /// <param name="classFilter">The class filter.</param> /// <param name="renderers">The renderers.</param> internal ReportGenerator(IParser parser, IAssemblyFilter assemblyFilter, IClassFilter classFilter, IEnumerable <IReportBuilder> renderers) { if (parser == null) { throw new ArgumentNullException("parser"); } if (assemblyFilter == null) { throw new ArgumentNullException("assemblyFilter"); } if (classFilter == null) { throw new ArgumentNullException("classFilter"); } if (renderers == null) { throw new ArgumentNullException("renderers"); } this.parser = parser; this.assemblyFilter = assemblyFilter; this.classFilter = classFilter; this.renderers = renderers; }
public ApplicationEngine(IAssemblyFinder assemblyFinder, IAssemblyFilter assemblyFilter, IAssemblyListWriterFactory assemblyListWriterFactory) { _assemblyFinder = assemblyFinder; _assemblyFilter = assemblyFilter; _assemblyListWriterFactory = assemblyListWriterFactory; }
public static string [] filterAssemblies(IAssemblyFilter filter) { var helperDomain = AppDomain.CreateDomain("helperDomain"); var assemblyLoader = (AssemblyLoader)helperDomain.CreateInstance(typeof(AssemblyLoader).Assembly.GetName().Name, typeof(AssemblyLoader).FullName).Unwrap(); var r = assemblyLoader.validateAssemblies(filter); AppDomain.Unload(helperDomain); return(r); }
public string [] validateAssemblies(IAssemblyFilter filter) { var list = new List <string>(); foreach (var dll in Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.dll")) { var assembly = Assembly.LoadFrom(dll); if (filter.isAllowed(assembly)) { list.Add(assembly.ManifestModule.FullyQualifiedName); } } return(list.ToArray()); }
public ApplicationStartup RegisterAssemblyFilter(IAssemblyFilter assemblyFilter) { if (this.IsStarted) { throw new FriendlyException("程序已启动,无法注册"); } if (assemblyFilter != null) { this.assemblyFilters.Add(assemblyFilter); } return(this); }
/// <summary> /// Sets the startup IAssemblyFilter /// </summary> /// <param name="assemblyFilter"></param> /// <returns></returns> public DefaultsExpression UseAssemblyFilter(IAssemblyFilter assemblyFilter) { AssemblyFilter = assemblyFilter ?? throw new ArgumentNullException(nameof(assemblyFilter)); return(this); }