Creating Custom Text Template Directive Processors
The text template transformation process takes a text template file as the input and produces a text file as the output. The text template transformation engine controls the process, and the engine interacts with a text template transformation host and one or more text template directive processors to complete the process. For more information, see.
To create a custom directive processor, you create a class that inherits from eitheror .
The difference between these two is that DirectiveProcessor implements the minimum interface that is necessary to capture parameters from the user and to provide functionality to the generated transformation class. RequiresProvidesDirectiveProcessor defines and implements a design pattern called requires/provides. RequiresProvidesDirectiveProcessor provides richer facilities to capture parameters from the user and to provide functionality to the generated transformation class, with specific property names. The language user of the text template can also override the property names.
For example, a custom directive processor might accept a file name from the language user, open and read the file, and then store the text of the file in a variable that is named fileText. A custom requires/provides directive processor might accept a file name from the user and the name of the variable in which the user would like to store the text. This processor would open and read the file and then store the text of the file in a variable that has the name that the language user specified.
In This Section
Walks you through the process of creating a custom directive processor that reads an XML file.
Lists the steps to create a custom directive processor in C# or Visual Basic.
Lists the steps to set registry keys for a custom directive processor.