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"))

适用于

另请参阅