CodeTypeDeclarationCollection.Remove(CodeTypeDeclaration) 方法

定义

从集合中移除指定的 CodeTypeDeclaration 对象。

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

参数

value
CodeTypeDeclaration

要从该集合中移除的 CodeTypeDeclaration

例外

未在集合中找到指定的对象。

示例

下面的示例演示如何使用 Remove 方法从 CodeTypeDeclarationCollection中删除 CodeTypeDeclaration 对象。

// Removes the specified CodeTypeDeclaration from the collection.
CodeTypeDeclaration^ declaration = gcnew CodeTypeDeclaration( "TestType" );
collection->Remove( declaration );
// Removes the specified CodeTypeDeclaration from the collection.
CodeTypeDeclaration declaration = new CodeTypeDeclaration("TestType");
collection.Remove( declaration );
' Removes the specified CodeTypeDeclaration from the collection.
Dim declaration As New CodeTypeDeclaration("TestType")
collection.Remove(declaration)

适用于