PersonalizationDictionary.IDictionary.Add(Object, Object) 方法

定义

实现 Add(Object, Object) 类的 PersonalizationDictionary 方法。Implements the Add(Object, Object) method for the PersonalizationDictionary class.

 virtual void System.Collections.IDictionary.Add(System::Object ^ key, System::Object ^ value) = System::Collections::IDictionary::Add;
void IDictionary.Add (object key, object value);
abstract member System.Collections.IDictionary.Add : obj * obj -> unit
override this.System.Collections.IDictionary.Add : obj * obj -> unit
Sub Add (key As Object, value As Object) Implements IDictionary.Add

参数

key
Object

要用作个性化设置字典中项的键的 StringThe String to use as the key for an item in the personalization dictionary.

value
Object

要添加到个性化设置字典中的 PersonalizationEntryThe PersonalizationEntry to add to the personalization dictionary.

实现

例外

valuenullvalue is null.

key 不是 String 对象。key is not a String object.

- 或 --or- value 不是 PersonalizationEntry 对象。value is not a PersonalizationEntry object.

注解

Add方法将检查多个详细信息,以确保 valuekey 在尝试将它们添加到个性化设置字典之前的有效性。The Add method checks several details to ensure the validity of value and key before attempting to add them to the personalization dictionary. 如果检查成功,则该方法将调用 PersonalizationDictionary 类自身的 Add 方法,并向其传递 keyvalue 参数。If the checks are successful, the method calls the PersonalizationDictionary class's own Add method, passing to it the key and value parameters.

适用于

另请参阅