Redigera

Dela via


CodeAttributeDeclarationCollection.Insert Method

Definition

Inserts the specified CodeAttributeDeclaration object into the collection at the specified index.

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

The zero-based index where the specified object should be inserted.

Examples

The following example demonstrates how to use the Insert method to add a CodeAttributeDeclaration object to the CodeAttributeDeclarationCollection.

// Inserts a CodeAttributeDeclaration at index 0 of the collection.
array<CodeAttributeArgument^>^temp4 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
collection->Insert( 0, gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp4 ) );
// 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"))))

Applies to

See also