Share via


RequiresProvidesDirectiveProcessor.ProcessDirective Method

Processes a single directive from a text template file.

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

Syntax

'Declaration
Public Overrides Sub ProcessDirective ( _
    directiveName As String, _
    arguments As IDictionary(Of String, String) _
)
public override void ProcessDirective(
    string directiveName,
    IDictionary<string, string> arguments
)
public:
virtual void ProcessDirective(
    String^ directiveName, 
    IDictionary<String^, String^>^ arguments
) override
abstract ProcessDirective : 
        directiveName:string * 
        arguments:IDictionary<string, string> -> unit  
override ProcessDirective : 
        directiveName:string * 
        arguments:IDictionary<string, string> -> unit
public override function ProcessDirective(
    directiveName : String, 
    arguments : IDictionary<String, String>
)

Parameters

  • directiveName
    Type: System.String

    The name of the directive to process.

Implements

IDirectiveProcessor.ProcessDirective(String, IDictionaryString, String)

Exceptions

Exception Condition
ArgumentNullException

directiveName is nulla null reference (Nothing in Visual Basic).

-or-

arguments is nulla null reference (Nothing in Visual Basic).

InvalidOperationException

A processing run has already started but not yet finished.

DirectiveProcessorException

The processor does not support the directive.

-or-

A requires parameter cannot be resolved.

Remarks

One directive processor can support many directives. When ProcessDirective is called, conditional statements run using the directive that is called.

This method is called once for each call in a text template to a directive that this processor supports. The directives process the arguments and generate code to be added to the generated transformation class.

This method is overridden in RequiresProvidesDirectiveProcessor to call various virtual methods in RequiresProvidesDirectiveProcessor. For example, GenerateTransformCode, GeneratePostInitializationCode, and InitializeProvidesDictionary.

You do not usually need to override this method in classes that derive from RequiresProvidesDirectiveProcessor.

.NET Framework Security

See Also

Reference

RequiresProvidesDirectiveProcessor Class

Microsoft.VisualStudio.TextTemplating Namespace

ProcessDirective

Other Resources

Creating Custom T4 Text Template Directive Processors