共用方式為


CodeTypeDeclarationCollection.Insert(Int32, CodeTypeDeclaration) 方法

定義

將指定的 CodeTypeDeclaration 物件插入至集合中所指定索引處。

public:
 void Insert(int index, System::CodeDom::CodeTypeDeclaration ^ value);
public void Insert (int index, System.CodeDom.CodeTypeDeclaration value);
member this.Insert : int * System.CodeDom.CodeTypeDeclaration -> unit
Public Sub Insert (index As Integer, value As CodeTypeDeclaration)

參數

index
Int32

以零起始的索引,是應將指定物件插入的位置。

value
CodeTypeDeclaration

要插入的 CodeTypeDeclaration 物件。

範例

下列範例示範如何使用 Insert 方法將 物件CodeTypeDeclarationCollection插入 CodeTypeDeclaration

// Inserts a CodeTypeDeclaration at index 0 of the collection.
collection->Insert( 0, gcnew CodeTypeDeclaration( "TestType" ) );
// Inserts a CodeTypeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeTypeDeclaration("TestType") );
' Inserts a CodeTypeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeTypeDeclaration("TestType"))

適用於

另請參閱