This topic has not yet been rated - Rate this topic

ITextTemplating.PreprocessTemplate Method

Visual Studio 2010

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)
string PreprocessTemplate(
	string inputFile,
	string content,
	ITextTemplatingCallback callback,
	string className,
	string classNamespace,
	out string[] references
)

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: 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.

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.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Advertisement