CodeAttributeArgumentCollection.Insert(Int32, CodeAttributeArgument) 方法

定义

将指定的 CodeAttributeArgument 对象插入集合中指定的索引位置。Inserts the specified CodeAttributeArgument object into the collection at the specified index.

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

参数

index
Int32

从零开始的索引,应在此处插入指定对象。The zero-based index where the specified object should be inserted.

value
CodeAttributeArgument

要插入的 CodeAttributeArgument 对象。The CodeAttributeArgument object to insert.

示例

下面的示例演示如何使用 Insert 方法将 CodeAttributeArgument 对象添加到 CodeAttributeArgumentCollectionThe following example demonstrates how to use the Insert method to add a CodeAttributeArgument object to a CodeAttributeArgumentCollection.

// Inserts a CodeAttributeArgument at index 0 of the collection.
collection->Insert( 0, gcnew CodeAttributeArgument( "Test Boolean Argument",gcnew CodePrimitiveExpression( true ) ) );
// Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert( 0, new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true)) );
' Inserts a CodeAttributeArgument at index 0 of the collection.
collection.Insert(0, New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True)))

适用于