Engine Class

 

The text template transformation engine.

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

System.Object
  Microsoft.VisualStudio.TextTemplating.Engine

Public Class Engine
	Implements IDebugTextTemplatingEngine, ITextTemplatingEngine

NameDescription
System_CAPS_pubmethodEngine()

Initializes a new instance of the Engine class.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodPrepareTransformationRun(String, ITextTemplatingEngineHost, IDebugTransformationRunFactory)

Prepares an IDebugTransformationRun object to run the template.

System_CAPS_pubmethodPreprocessTemplate(String, ITextTemplatingEngineHost, String, String, String, String())

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

System_CAPS_pubmethodProcessTemplate(String, ITextTemplatingEngineHost)

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

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticCacheAssembliesOptionString

CacheAssemblies option string.

System_CAPS_pubfieldSystem_CAPS_staticTemplateFileParameterName

The text template transformation process takes a text template file as the input and produces a new text file as the output. The text template transformation engine component controls the process and interacts with a text template transformation host and one or more text template directive processors to complete the process. For more information, see Code Generation and T4 Text Templates.

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.

Dim engine As Engine = New Engine()

'read the text template
Dim input As String = File.ReadAllText(templateFileName)

'transform the text template
Dim output As String = engine.ProcessTemplate(input, host)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: