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

Индекс, отсчитываемый от нуля, по которому следует вставить указанный объект.

value
CodeStatement

Вставляемый объект CodeStatement.

Примеры

В следующем примере показано, как использовать Insert метод для добавления CodeStatement объекта в CodeStatementCollection.

// Inserts a CodeStatement at index 0 of the collection.
collection->Insert( 0, gcnew CodeCommentStatement( "Test comment statement" ) );
// 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"))

Применяется к

См. также раздел