IEditorFormatMap.AddProperties 方法

为新键添加一个 ResourceDictionary

命名空间:  Microsoft.VisualStudio.Text.Classification
程序集:  Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)

语法

声明
Sub AddProperties ( _
    key As String, _
    properties As ResourceDictionary _
)
void AddProperties(
    string key,
    ResourceDictionary properties
)
void AddProperties(
    String^ key, 
    ResourceDictionary^ properties
)
abstract AddProperties : 
        key:string * 
        properties:ResourceDictionary -> unit
function AddProperties(
    key : String, 
    properties : ResourceDictionary
)

参数

  • key
    类型:String

    键。

  • properties
    类型:ResourceDictionary

    新属性。

异常

异常 条件
ArgumentNullException

key 为空或 null 的。

ArgumentException

key 已存在映射。

备注

key 必须是新的密钥而不是现有项。添加一个新类型不会导致 FormatMappingChanged 引发事件。

.NET Framework 安全性

请参阅

参考

IEditorFormatMap 接口

Microsoft.VisualStudio.Text.Classification 命名空间