CodeExpressionCollection.Insert(Int32, CodeExpression) 方法

定義

將指定的 CodeExpression 物件插入集合中指定的索引。

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

參數

index
Int32

以零為基礎的索引,應該插入指定的物件。

value
CodeExpression

CodeExpression要插入的物件。

範例

以下範例示範如何使用此 Insert 方法將物件加入 CodeExpressionCodeExpressionCollection

// Inserts a CodeExpression at index 0 of the collection.
collection.Insert( 0, new CodePrimitiveExpression(true) );
' Inserts a CodeExpression at index 0 of the collection.
collection.Insert(0, New CodePrimitiveExpression(True))

適用於

另請參閱