/// <summary> /// Initializes a new instance of the <see cref="NancyCSharpRazorCodeParser"/> class. /// </summary> /// <param name="razorAssemblyProvider">An <see cref="RazorAssemblyProvider"/> instance.</param> public NancyCSharpRazorCodeParser(RazorAssemblyProvider razorAssemblyProvider) { this.razorAssemblyProvider = razorAssemblyProvider; this.MapDirectives(this.ModelDirective, "model"); this.clrTypeResolver = new CSharpClrTypeResolver(this.razorAssemblyProvider); }
/// <summary> /// Initializes a new instance of the <see cref="CSharpRazorViewRenderer"/> class. /// </summary> public CSharpRazorViewRenderer(RazorAssemblyProvider razorAssemblyProvider) { this.Assemblies = new List<string> { typeof(Binder).Assembly.Location }; this.ModelCodeGenerator = typeof(ModelCodeGenerator); this.Provider = new Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider(); this.Host = new NancyRazorEngineHost(new CSharpRazorCodeLanguage(), razorAssemblyProvider); this.Host.NamespaceImports.Add("Microsoft.CSharp.RuntimeBinder"); }
/// <summary> /// Initializes a new instance of the <see cref="CSharpRazorViewRenderer"/> class. /// </summary> public CSharpRazorViewRenderer(RazorAssemblyProvider razorAssemblyProvider) { this.Assemblies = new List <string> { typeof(Binder).Assembly.Location }; this.ModelCodeGenerator = typeof(ModelCodeGenerator); this.Provider = new Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider(); this.Host = new NancyRazorEngineHost(new CSharpRazorCodeLanguage(), razorAssemblyProvider); this.Host.NamespaceImports.Add("Microsoft.CSharp.RuntimeBinder"); }
public CSharpClrTypeResolver(RazorAssemblyProvider razorAssemblyProvider) : base(razorAssemblyProvider, CSharpSymbolType.Identifier, CSharpSymbolType.Keyword, CSharpSymbolType.Dot, CSharpSymbolType.WhiteSpace, CSharpSymbolType.LeftBracket, CSharpSymbolType.RightBracket) { }
/// <summary> /// Initializes a new instance of the <see cref="NancyCSharpRazorBuildProvider"/> class. /// </summary> /// <param name="razorAssemblyProvider">An <see cref="RazorAssemblyProvider"/> instance.</param> public NancyCSharpRazorBuildProvider(RazorAssemblyProvider razorAssemblyProvider) { this.compilerType = this.GetDefaultCompilerTypeForLanguage("C#"); this.host = new NancyRazorEngineHost(new CSharpRazorCodeLanguage(), razorAssemblyProvider); }