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.
- content
Type: System.String
The text of the template
- callback
Type: Microsoft.VisualStudio.TextTemplating.VSHost.ITextTemplatingCallback
You can supply an object that will be called if errors are reported. Optional.
- className
Type: System.String
The name of the class to generate
- classNamespace
Type: System.String
The namespace within which to generate the class
- references
Type: array<System.String[]%
The set of assemblies referenced by the template in assembly directives. For more information, see T4 Assembly Directive
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.