ConfigurationElementCollection.BaseRemove(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Removes a ConfigurationElement from the collection.
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)
Parameters
- key
- Object
The key of the ConfigurationElement to remove.
Exceptions
No ConfigurationElement with the specified key exists in the collection, the element has already been removed, or the element cannot be removed because the value of its Type is not AddRemoveClearMap.
Examples
The following code example shows how to call the BaseRemove method.
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
Remarks
The BaseRemove method inserts a <remove>
directive into the configuration file for the ConfigurationElement with the specified key.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈