CodeGeneratorContext.Create 方法

定义

此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。 创建 CodeGeneratorContext 类的新实例。

public static System.Web.Razor.Generator.CodeGeneratorContext Create(System.Web.Razor.RazorEngineHost host, string className, string rootNamespace, string sourceFile, bool shouldGenerateLinePragmas);
static member Create : System.Web.Razor.RazorEngineHost * string * string * string * bool -> System.Web.Razor.Generator.CodeGeneratorContext
Public Shared Function Create (host As RazorEngineHost, className As String, rootNamespace As String, sourceFile As String, shouldGenerateLinePragmas As Boolean) As CodeGeneratorContext

参数

host
RazorEngineHost

Razor 引擎主机。

className
String

所生成类的类型声明的类名称。

rootNamespace
String

所生成命名空间声明的名称。

sourceFile
String

源文件。

shouldGenerateLinePragmas
Boolean

如果为 true,则启用行杂注的生成;否则为 false。

返回

代码生成器上下文的新创建的实例。

适用于