Engine::PreprocessTemplate Method (String^, ITextTemplatingEngineHost^, String^, String^, String^, array<String^>^)

 

Generates code from a template that, when it is compiled and run, will produce the template output.

Namespace:   Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating.12.0 (in Microsoft.VisualStudio.TextTemplating.12.0.dll)

public:
virtual String^ PreprocessTemplate(
	String^ content,
	ITextTemplatingEngineHost^ host,
	String^ className,
	String^ classNamespace,
	[OutAttribute] String^% language,
	[OutAttribute] array<String^>^% references
) sealed

Parameters

content
Type: System::String^

The content of the template.

host
Type: Microsoft.VisualStudio.TextTemplating::ITextTemplatingEngineHost^

A template host, which should implement ITextTemplatingEngineHost.

className
Type: System::String^

The name of the class that you want the template code to have.

classNamespace
Type: System::String^

The namespace in which you want the template code to be generated.

language
Type: System::String^

The language of the generated code.

references
Type: array<System::String^>^

Assemblies specified by the template or the host.

Return Value

Type: System::String^

A string that can be compiled.

For more information, see Run-Time Text Generation with T4 Text Templates and Processing Text Templates by using a Custom Host.

System_CAPS_tipTip

If you are writing a package or extension that will run within Visual Studio, consider using the text templating service instead of writing your own host. For more information, see Invoking Text Transformation in a VS Extension.

Return to top
Show: