using NCC.Dependency; using NCC.Reflection; using Microsoft.CodeAnalysis; using System.Collections.Generic; using System.Reflection; namespace NCC.ViewEngine { /// /// 视图引擎编译选项 /// [SuppressSniffer] public class ViewEngineOptions { /// /// 构造函数 /// public ViewEngineOptions() { ReferencedAssemblies = new HashSet() { typeof(object).Assembly, typeof(ViewEngineModel).Assembly, typeof(System.Collections.IList).Assembly, typeof(IEnumerable<>).Assembly, Reflect.GetAssembly("Microsoft.CSharp"), Reflect.GetAssembly("System.Runtime"), Reflect.GetAssembly("System.Linq"), Reflect.GetAssembly("System.Linq.Expressions") }; } /// /// 引用程序集 /// public HashSet ReferencedAssemblies { get; set; } /// /// 元数据引用 /// public HashSet MetadataReferences { get; set; } = new HashSet(); /// /// 模板命名空间 /// public string TemplateNamespace { get; set; } = "NCC.ViewEngine"; /// /// 继承 /// public string Inherits { get; set; } = "NCC.ViewEngine.Template.Models"; /// /// 默认 Using /// public HashSet DefaultUsings { get; set; } = new HashSet() { "System.Linq", "System.Collections", "System.Collections.Generic" }; } }