Engine::ProcessTemplate Method (String^, ITextTemplatingEngineHost^)

 

Transforms the contents of a text template file to produce the generated text output.

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

public:
virtual String^ ProcessTemplate(
	String^ content,
	ITextTemplatingEngineHost^ host
) sealed

Parameters

content
Type: System::String^

The contents of the text template file to be transformed.

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

The ITextTemplatingEngineHost that will host this engine.

Return Value

Type: System::String^

The generated text output of the text template file.

Exception Condition
ArgumentNullException

content is null.

-or-

host is null.

In Visual Studio, if a file has its Custom Tool property set to TextTemplatingFileGenerator, clicking Run Custom Tool in the user interface corresponds to calling ProcessTemplate to transform the template.

For more information, see and Processing Text Templates by using a Custom Host.b3d93bb5-f805-4ed1-8509-111ce8ce119b

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.

The following example demonstrates how to create an instance of the Engine, and calling ProcessTemplate to transform a text template.

This code example is part of a larger example provided for the ITextTemplatingEngineHost interface.

No code example is currently available or this language may not be supported.
Return to top
Show: