CodeDirectiveCollection.Remove(CodeDirective) 方法

定义

从集合中删除指定的 CodeDirective 对象。

public:
 void Remove(System::CodeDom::CodeDirective ^ value);
public void Remove(System.CodeDom.CodeDirective value);
member this.Remove : System.CodeDom.CodeDirective -> unit
Public Sub Remove (value As CodeDirective)

参数

value
CodeDirective

CodeDirective 从集合中移除的对象。

例外

集合中找不到指定的对象。

示例

下面的代码示例演示如何使用 Remove 该方法从集合中删除指定的 CodeDirectiveCollection 对象。 此示例是CodeDirectiveCollection类所提供的一个大型示例的一部分。

// Removes the specified CodeDirective from the collection.
CodeDirective directive = new CodeRegionDirective(CodeRegionMode.Start, "Region1");
collection.Remove(directive);
' Removes the specified CodeDirective from the collection.
Dim directive = New CodeRegionDirective(CodeRegionMode.Start, "Region1")
collection.Remove(directive)

适用于