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)

適用於