ITextTemplatingEngineHost Interface

The interface for the host that transforms text templates. This is available to directive processors and can also be accessed by text templates.

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

Syntax

'Declaration
Public Interface ITextTemplatingEngineHost
'Usage
Dim instance As ITextTemplatingEngineHost
public interface ITextTemplatingEngineHost
public interface class ITextTemplatingEngineHost
public interface ITextTemplatingEngineHost

Remarks

A host takes a text template file as the input and produces a text file as output. A typical host is the TextTemplatingFileGenerator tool that transforms templates in a Visual Studio project. It calls one or more directive processors to deal with different types of template. The members of this interface are accessible to the directive processors, and to the code of the text template. The text template engine controls this process and interacts with a host and one or more directive processors. To learn more about these components, see Generating Artifacts By Using Text Templates.

To make the host accessible to the code of a text template, set the hostspecific parameter of the template directive. For example:

<#@template language="c#" hostspecific="true" #>
<# // This template is specific to the TextTemplatingFileGenerator host,
   // which transforms templates in a Visual Studio project. #>
These are the projects in this solution:
<#=this.Host.ResolveParameterValue("-", "-", "projects") #>

If you want to use text templates outside Visual Studio or with custom tools, you can write a custom host, implementing this interface. For an example, see Walkthrough: Creating a Custom Text Template Host.

See Also

Reference

ITextTemplatingEngineHost Members

Microsoft.VisualStudio.TextTemplating Namespace

Other Resources

Walkthrough: Creating a Custom Text Template Host

Generating Artifacts By Using Text Templates

Change History

Date

History

Reason

Clarified some method descriptions.

Information enhancement.