RequiresProvidesDirectiveProcessor.InitializeRequiresDictionary Method

When overridden in a derived class, specifies the requires parameters for each directive.

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

Syntax

'Declaration
Protected MustOverride Sub InitializeRequiresDictionary ( _
    directiveName As String, _
    requiresDictionary As IDictionary(Of String, String) _
)
protected abstract void InitializeRequiresDictionary(
    string directiveName,
    IDictionary<string, string> requiresDictionary
)
protected:
virtual void InitializeRequiresDictionary(
    String^ directiveName, 
    IDictionary<String^, String^>^ requiresDictionary
) abstract
abstract InitializeRequiresDictionary : 
        directiveName:string * 
        requiresDictionary:IDictionary<string, string> -> unit
protected abstract function InitializeRequiresDictionary(
    directiveName : String, 
    requiresDictionary : IDictionary<String, String>
)

Parameters

  • directiveName
    Type: String

    The name of the directive.

  • requiresDictionary
    Type: IDictionary<String, String>

    An IDictionary that contains the standard parameters that this processor requires.

Remarks

Use this method to add key-value pairs to the requiresDictionary parameter. The key is the name of a requires parameter that the directive processor supports. The value of the parameter is the default value if the user does not specify a different value when calling the directive.

You put nulla null reference (Nothing in Visual Basic) in a parameter's value slot to indicate that the user must specify it.

This method is called by ProcessDirective.

Examples

The following example sets up the dictionary of items that this directive processor requires. This code example is part of a larger example that is provided for the RequiresProvidesDirectiveProcessor class.

protected override void InitializeRequiresDictionary(string directiveName, IDictionary<string, string> requiresDictionary)
{
if (StringComparer.InvariantCultureIgnoreCase.Compare(directiveName, DomDirectiveTag) == 0)
{
// Initialize the dictionary with nulls for each required parameter.
requiresDictionary[XmlFileRequiredParameterName] = null;
}
}

.NET Framework Security

See Also

Reference

RequiresProvidesDirectiveProcessor Class

Microsoft.VisualStudio.TextTemplating Namespace

InitializeProvidesDictionary

ProcessDirective

IDictionary