CodeAttributeDeclarationCollection.Insert Methode

Definitie

Hiermee voegt u het opgegeven CodeAttributeDeclaration object in de verzameling in de opgegeven index in.

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

Parameters

index
Int32

De op nul gebaseerde index waarin het opgegeven object moet worden ingevoegd.

value
CodeAttributeDeclaration

Het CodeAttributeDeclaration object dat moet worden ingevoegd.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de Insert methode gebruikt om een CodeAttributeDeclaration object toe te voegen aan de CodeAttributeDeclarationCollection.

// Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
' Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))

Van toepassing op

Zie ook