forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSharpRazorCodeLanguage.cs
More file actions
35 lines (32 loc) · 1.36 KB
/
CSharpRazorCodeLanguage.cs
File metadata and controls
35 lines (32 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Web.Razor;
using System.Web.Razor.Generator;
namespace ServiceStack.Razor.Compilation.CSharp
{
public class CSharpRazorCodeLanguage : System.Web.Razor.CSharpRazorCodeLanguage
{
/// <summary>
/// Initialises a new instance
/// </summary>
/// <param name="strictMode">Flag to determine whether strict mode is enabled.</param>
public CSharpRazorCodeLanguage(bool strictMode)
{
StrictMode = strictMode;
}
/// <summary>
/// Gets whether strict mode is enabled.
/// </summary>
public bool StrictMode { get; private set; }
/// <summary>
/// Creates the code generator.
/// </summary>
/// <param name="className">Name of the class.</param>
/// <param name="rootNamespaceName">Name of the root namespace.</param>
/// <param name="sourceFileName">Name of the source file.</param>
/// <param name="host">The host.</param>
/// <returns>An instance of <see cref="RazorCodeGenerator"/>.</returns>
public override RazorCodeGenerator CreateCodeGenerator(string className, string rootNamespaceName, string sourceFileName, RazorEngineHost host)
{
return new CSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host, StrictMode);
}
}
}