ITextTemplating.PreprocessTemplate Method

Process a text template to produce source code that can be invoked at run time.

Namespace:  Microsoft.VisualStudio.TextTemplating.VSHost
Assembly:  Microsoft.VisualStudio.TextTemplating.Interfaces.10.0 (in Microsoft.VisualStudio.TextTemplating.Interfaces.10.0.dll)

Syntax

'Declaration
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

Parameters

  • inputFile
    Type: System.String
    The filename of the template to process, for reference in error reports. Optional.
  • className
    Type: System.String
    The name of the class to generate
  • classNamespace
    Type: System.String
    The namespace within which to generate the class

Return Value

Type: System.String
Source code that can be compiled and run to produce the output defined by the template.

Remarks

This method produces source code in C# or Visual Basic that can be compiled and run to produce the output defined by the template. Typically, you would incorporate the source code in an application.

For more information, see Invoking Text Transformation in a VS Extension and Run-Time Text Generation by using Preprocessed T4 Text Templates.

.NET Framework Security

See Also

Reference

ITextTemplating Interface

Microsoft.VisualStudio.TextTemplating.VSHost Namespace