Share via


CodeStatementCollection.Insert(Int32, CodeStatement) Méthode

Définition

Insère l'objet CodeStatement indiqué dans la collection à l'index spécifié.

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)

Paramètres

index
Int32

Index de base zéro dans lequel l'objet spécifié doit être inséré.

value
CodeStatement

Objet CodeStatement à insérer.

Exemples

L’exemple suivant montre comment utiliser la Insert méthode pour ajouter un CodeStatement objet à un 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"))

S’applique à

Voir aussi