ConfigurationElementCollection.BaseRemove(Object) 方法

定义

从集合中删除 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 中的指定键。

适用于