共用方式為


ConfigurationElementCollection.BaseRemove(Object) 方法

定義

從集合移除 ConfigurationElement

protected:
 void BaseRemove(System::Object ^ key);
protected public:
 void BaseRemove(System::Object ^ key);
protected void BaseRemove (object key);
protected internal void BaseRemove (object key);
member this.BaseRemove : obj -> unit
Protected Sub BaseRemove (key As Object)
Protected Friend 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 中。

適用於