Share via


ViewDataDictionary.Remove 方法

定义

重载

Remove(KeyValuePair<String,Object>)

从集合中移除指定对象的第一个匹配项。

Remove(String)

使用指定键从集合中移除元素。

Remove(KeyValuePair<String,Object>)

从集合中移除指定对象的第一个匹配项。

public bool Remove (System.Collections.Generic.KeyValuePair<string,object> item);
abstract member Remove : System.Collections.Generic.KeyValuePair<string, obj> -> bool
override this.Remove : System.Collections.Generic.KeyValuePair<string, obj> -> bool
Public Function Remove (item As KeyValuePair(Of String, Object)) As Boolean

参数

item
KeyValuePair<String,Object>

要从集合中移除的对象。

返回

如果 已成功从集合中删除,则 item 为 true;否则为 false。 如果在 item 集合中找不到 ,此方法也会返回 false。

实现

例外

该集合是只读的。

适用于

Remove(String)

使用指定键从集合中移除元素。

public bool Remove (string key);
abstract member Remove : string -> bool
override this.Remove : string -> bool
Public Function Remove (key As String) As Boolean

参数

key
String

要移除的元素的键。

返回

如果成功移除了该元素,则为 true;否则为 false。 如果在 key 原始集合中找不到 ,则此方法也返回 false。

实现

例外

该集合是只读的。

key 为 null。

适用于