ITextTemplating.PreprocessTemplate 方法

处理文本模板以生成可在运行时调用的源代码。

命名空间:  Microsoft.VisualStudio.TextTemplating.VSHost
程序集:  Microsoft.VisualStudio.TextTemplating.Interfaces.10.0(在 Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll 中)

语法

声明
Function PreprocessTemplate ( _
    inputFile As String, _
    content As String, _
    callback As ITextTemplatingCallback, _
    className As String, _
    classNamespace As String, _
    <OutAttribute> ByRef references As String() _
) As String
string PreprocessTemplate(
    string inputFile,
    string content,
    ITextTemplatingCallback callback,
    string className,
    string classNamespace,
    out string[] references
)
String^ PreprocessTemplate(
    String^ inputFile, 
    String^ content, 
    ITextTemplatingCallback^ callback, 
    String^ className, 
    String^ classNamespace, 
    [OutAttribute] array<String^>^% references
)
abstract PreprocessTemplate : 
        inputFile:string * 
        content:string * 
        callback:ITextTemplatingCallback * 
        className:string * 
        classNamespace:string * 
        references:string[] byref -> string 
function PreprocessTemplate(
    inputFile : String, 
    content : String, 
    callback : ITextTemplatingCallback, 
    className : String, 
    classNamespace : String, 
    references : String[]
) : String

参数

  • inputFile
    类型:System.String
    用于错误报告引用,要生成的模板文件名。可选。
  • classNamespace
    类型:System.String
    将在其中生成该类的命名空间

返回值

类型:System.String
可编译的源代码,并运行生成由模板定义的输出。

备注

此方法在 C# 或Visual Basic 中生成的源代码可以被编译,并可以运行产生模板定义的输出。 通常,您会将源代码纳入应用程序中。

有关更多信息,请参见在 VS 扩展中调用文本转换使用预处理 T4 文本模板生成运行时文本

.NET Framework 安全性

请参见

参考

ITextTemplating 接口

Microsoft.VisualStudio.TextTemplating.VSHost 命名空间