为新键添加一个 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。