CodeStatementCollection.Insert(Int32, CodeStatement) メソッド

定義

指定した CodeStatement オブジェクトをコレクション内の指定したインデックス位置に挿入します。

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

パラメーター

index
Int32

指定したオブジェクトを挿入する 0 から始まるインデックス。

value
CodeStatement

挿入する CodeStatement オブジェクト。

次の例では、 Insert メソッドを使用して、 CodeStatement オブジェクトを CodeStatementCollectionに追加する方法を示します。

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

適用対象

こちらもご覧ください