RequiresProvidesDirectiveProcessor.ProcessDirective Method

Processes a single directive from a text template file.

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

Syntax

'宣言
Public Overrides Sub ProcessDirective ( _
    directiveName As String, _
    arguments As IDictionary(Of String, String) _
)
'使用
Dim instance As RequiresProvidesDirectiveProcessor
Dim directiveName As String
Dim arguments As IDictionary(Of String, String)

instance.ProcessDirective(directiveName, _
    arguments)
public override void ProcessDirective(
    string directiveName,
    IDictionary<string, string> arguments
)
public:
virtual void ProcessDirective(
    String^ directiveName, 
    IDictionary<String^, String^>^ arguments
) override
public override function ProcessDirective(
    directiveName : String, 
    arguments : IDictionary<String, String>
)

Parameters

  • directiveName
    Type: System.String

    The name of the directive to process.

Exceptions

Exception Condition
ArgumentNullException

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

-or-

arguments is a 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.

Permissions

See Also

Concepts

Directive Processors

Reference

RequiresProvidesDirectiveProcessor Class

RequiresProvidesDirectiveProcessor Members

Microsoft.VisualStudio.TextTemplating Namespace

ProcessDirective