NameScope.Remove 方法

定義

從集合中移除指定的物件。

多載

Remove(KeyValuePair<String,Object>)

從集合中移除指定的物件。

Remove(String)

從集合移除指定之名稱的對應。

Remove(KeyValuePair<String,Object>)

從集合中移除指定的物件。

public:
 virtual bool Remove(System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^> item);
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>

要從集合移除的物件,指定為 KeyValuePair<TKey,TValue> (索引鍵為 String,值為 Object)。

傳回

如果從集合成功移除項目則為 true,否則為 false。 如果集合中找不到項目,也會傳回 false

實作

備註

因為 NameScope 是字典,所以沒有第一次出現的概念;任何指定的 KeyValuePair<TKey,TValue> 都保證是唯一的。

適用於

Remove(String)

從集合移除指定之名稱的對應。

public:
 virtual bool Remove(System::String ^ key);
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

字串索引鍵,這是要移除之 XAML 名稱範圍對應的名稱。

傳回

如果從集合成功移除項目則為 true,否則為 false。 如果集合中找不到項目,也會傳回 false

實作

備註

這個方法基本上會 UnregisterName 包裝 ,以在 中引發例外 UnregisterName 狀況的情況下傳回 false

適用於