ConfigurationElementCollection.BaseRemove(Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從集合中移除 ConfigurationElement。
protected public:
void BaseRemove(System::Object ^ key);
protected:
void BaseRemove(System::Object ^ key);
protected internal void BaseRemove(object key);
protected void BaseRemove(object key);
member this.BaseRemove : obj -> unit
Protected Friend Sub BaseRemove (key As Object)
Protected Sub BaseRemove (key As Object)
參數
- key
- Object
鑰匙是 ConfigurationElement 要移除的。
例外狀況
集合中不 ConfigurationElement 存在該指定鍵的 ,元素已被移除,或該元素無法移除,因為其值 Type 不是 AddRemoveClearMap。
範例
以下程式碼範例展示了如何呼叫該 BaseRemove 方法。
public void Remove(UrlConfigElement url)
{
if (BaseIndexOf(url) >= 0)
{
BaseRemove(url.Name);
// Your custom code goes here.
Console.WriteLine("UrlsCollection: {0}", "Removed collection element!");
}
}
Public Sub Remove(ByVal url As UrlConfigElement)
If BaseIndexOf(url) >= 0 Then
BaseRemove(url.Name)
' Your custom code goes here.
Console.WriteLine("UrlsCollection: {0}", "Removed collection element!")
End If
End Sub
備註
此 BaseRemove 方法會在 <remove> 設定檔 ConfigurationElement 中插入一個指令,並使用指定金鑰。