CodeCommentStatementCollection.Insert(Int32, CodeCommentStatement) 方法

定義

CodeCommentStatement 插入位於指定索引的集合。

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

參數

index
Int32

以零起始的索引,是應插入項目的位置。

value
CodeCommentStatement

要插入的 CodeCommentStatement 物件。

範例

下列範例示範如何使用 Insert 方法將 物件新增 CodeCommentStatementCodeCommentStatementCollection

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

適用於

另請參閱