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 ディレクティブを挿入します。

適用対象