RequiresProvidesDirectiveProcessor.InitializeProvidesDictionary 方法

在派生类中重写时,指定各个指令的“provides”参数。

命名空间:  Microsoft.VisualStudio.TextTemplating
程序集:  Microsoft.VisualStudio.TextTemplating.10.0(在 Microsoft.VisualStudio.TextTemplating.10.0.dll 中)

语法

声明
Protected MustOverride Sub InitializeProvidesDictionary ( _
    directiveName As String, _
    providesDictionary As IDictionary(Of String, String) _
)
protected abstract void InitializeProvidesDictionary(
    string directiveName,
    IDictionary<string, string> providesDictionary
)
protected:
virtual void InitializeProvidesDictionary(
    String^ directiveName, 
    IDictionary<String^, String^>^ providesDictionary
) abstract
abstract InitializeProvidesDictionary : 
        directiveName:string * 
        providesDictionary:IDictionary<string, string> -> unit 
protected abstract function InitializeProvidesDictionary(
    directiveName : String, 
    providesDictionary : IDictionary<String, String>
)

参数

备注

使用此方法将键-值对添加到 providesDictionary 参数。 该键是指令处理器支持的 provides 参数的名称。 如果用户在调用指令时未指定不同值,则该参数的值为默认值。

此方法由 ProcessDirective 调用。

示例

下面的示例设置此指令处理器所提供项的词典。 此代码示例摘自一个为 RequiresProvidesDirectiveProcessor 类提供的更大的示例。

protected override void InitializeProvidesDictionary(string directiveName, IDictionary<string, string> providesDictionary)
{
if (StringComparer.InvariantCultureIgnoreCase.Compare(directiveName, DomDirectiveTag) == 0)
{
// Populate the dictionary with the default names that will be used.
providesDictionary[DomProvidedParameterName] = DomProvidedParameterName;
}
}

.NET Framework 安全性

请参见

参考

RequiresProvidesDirectiveProcessor 类

Microsoft.VisualStudio.TextTemplating 命名空间

InitializeRequiresDictionary

ProcessDirective

IDictionary