DirectiveProcessor Class
The abstract base class for a concrete directive processor.
Assembly: Microsoft.VisualStudio.TextTemplating.12.0 (in Microsoft.VisualStudio.TextTemplating.12.0.dll)
Microsoft.VisualStudio.TextTemplating::DirectiveProcessor
Microsoft.VisualStudio.TextTemplating::ParameterDirectiveProcessor
Microsoft.VisualStudio.TextTemplating::RequiresProvidesDirectiveProcessor
| Name | Description | |
|---|---|---|
![]() | DirectiveProcessor() | When overridden in a derived class, initializes a new instance of the DirectiveProcessor class. |
| Name | Description | |
|---|---|---|
![]() | Errors | Gets the errors that occurred when processing directives. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | (Inherited from Object.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | FinishProcessingRun() | When overridden in a derived class, finishes a round of directive processing. |
![]() | GetClassCodeForProcessingRun() | When overridden in a derived class, gets code to add to the generated transformation class. |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetImportsForProcessingRun() | When overridden in a derived class, gets namespaces to import into the generated transformation class. |
![]() | GetPostInitializationCodeForProcessingRun() | When overridden in a derived class, gets code to add to the end of the initialize method of the generated transformation class. |
![]() | GetPreInitializationCodeForProcessingRun() | When overridden in a derived class, gets code to add to the start of the initialize method of the generated transformation class. |
![]() | GetReferencesForProcessingRun() | When overridden in a derived class, gets references to pass to the generated transformation class compiler. |
![]() | GetTemplateClassCustomAttributes() | Get any custom attributes to put on the template class. |
![]() | GetType() | (Inherited from Object.) |
![]() | Initialize(ITextTemplatingEngineHost^) | When overridden in a derived class, initializes the processor instance. |
![]() | IsDirectiveSupported(String^) | When overridden in a derived class, determines whether the directive processor supports the specified directive. |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ProcessDirective(String^, IDictionary<String^, String^>^) | When overridden in a derived class, processes a single directive from a template file. |
![]() | StartProcessingRun(CodeDomProvider^, String^, CompilerErrorCollection^) | When overridden in a derived class, starts a round of directive processing. |
![]() | ToString() | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDirectiveProcessor::SetProcessingRunIsHostSpecific(Boolean) |
The text template transformation process has two steps. In the first step, the text template transformation engine creates a class that is referred to as the generated transformation class. In the second step, the engine compiles and executes the generated transformation class, to produce the generated text output.
Directive processors work by adding code to the generated transformation class. You call directives from a text template, and after you call a directive, the rest of the code you write in your text template can rely on the functionality provided by the directive. You can write your own custom directive processors to provide custom functionality to text templates.
For more information, see Creating Custom T4 Text Template Directive Processors.
The text template transformation engine will hold a singleton instance of any required DirectiveProcessor classes.
DirectiveProcessor implements a state machine.
For example, if a text template has three directive calls to the same directive processor, the engine will call the following methods in the following order:
M:Microsoft.VisualStudio.TextTemplating.DirectiveProcessor.StartProcessingRun(System.CodeDom.Compiler.CodeDomProvider)
The following example creates a custom directive processor. The custom directive processor contains a directive that reads an XML file. The directive stores the XML in an XmlDocument variable, and exposes the XmlDocument through a property.
For more information, see Walkthrough: Creating a Custom Directive Processor.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




