共用方式為


Engine.PreprocessTemplate 方法

會從範本的程式碼,請在 中,在編譯和執行時,會產生範本的輸出。

命名空間:  Microsoft.VisualStudio.TextTemplating
組件:  Microsoft.VisualStudio.TextTemplating.11.0 (在 Microsoft.VisualStudio.TextTemplating.11.0.dll 中)

語法

'宣告
Public Function PreprocessTemplate ( _
    content As String, _
    host As ITextTemplatingEngineHost, _
    className As String, _
    classNamespace As String, _
    <OutAttribute> ByRef language As String, _
    <OutAttribute> ByRef references As String() _
) As String
public string PreprocessTemplate(
    string content,
    ITextTemplatingEngineHost host,
    string className,
    string classNamespace,
    out string language,
    out string[] references
)
public:
virtual String^ PreprocessTemplate(
    String^ content, 
    ITextTemplatingEngineHost^ host, 
    String^ className, 
    String^ classNamespace, 
    [OutAttribute] String^% language, 
    [OutAttribute] array<String^>^% references
) sealed
abstract PreprocessTemplate : 
        content:string * 
        host:ITextTemplatingEngineHost * 
        className:string * 
        classNamespace:string * 
        language:string byref * 
        references:string[] byref -> string 
override PreprocessTemplate : 
        content:string * 
        host:ITextTemplatingEngineHost * 
        className:string * 
        classNamespace:string * 
        language:string byref * 
        references:string[] byref -> string 
public final function PreprocessTemplate(
    content : String, 
    host : ITextTemplatingEngineHost, 
    className : String, 
    classNamespace : String, 
    language : String, 
    references : String[]
) : String

參數

  • className
    型別:System.String
    您要範本程式碼具有的類別名稱。
  • classNamespace
    型別:System.String
    您要在其中產生範本程式碼的命名空間。
  • language
    型別:System.String%
    所產生之程式碼的語言。
  • references
    型別:array<System.String[]%
    範本或主應用程式所指定的組件。

傳回值

型別:System.String
可編譯的字串。

實作

ITextTemplatingEngine.PreprocessTemplate(String, ITextTemplatingEngineHost, String, String, String%, array<String[]%)

備註

如需詳細資訊,請參閱 使用 T4 文字範本在執行階段產生文字使用自訂主機處理文字範本

提示

如果您正在撰寫在 Visual Studio內執行的封裝或擴充功能,請考慮使用文字範本化服務而不是撰寫自己的主應用程式。如需詳細資訊,請參閱叫用 VS 擴充功能中的文字轉換

.NET Framework 安全性

請參閱

參考

Engine 類別

Microsoft.VisualStudio.TextTemplating 命名空間