CodeParameterDeclarationExpressionCollection.CopyTo 方法

定義

將集合物件複製到從指定索引開始的一維 Array 實例。

public:
 void CopyTo(cli::array <System::CodeDom::CodeParameterDeclarationExpression ^> ^ array, int index);
public void CopyTo(System.CodeDom.CodeParameterDeclarationExpression[] array, int index);
member this.CopyTo : System.CodeDom.CodeParameterDeclarationExpression[] * int -> unit
Public Sub CopyTo (array As CodeParameterDeclarationExpression(), index As Integer)

參數

array
CodeParameterDeclarationExpression[]

一維 Array 值是從集合複製的值的目的地。

index
Int32

開始插入的陣列索引。

例外狀況

目的陣列是多維的。

-或-

CodeParameterDeclarationExpressionCollection 元素數大於參數指定 index 的目標陣列索引與目標陣列末端之間的可用空間。

參數 arraynull

參數 index 小於目標陣列的最小索引。

範例

以下範例示範如何將 a CodeParameterDeclarationExpressionCollection 的內容複製到 Array 指定的索引值起始處。

// Copies the contents of the collection beginning at index 0 to the specified CodeParameterDeclarationExpression array.
// 'parameters' is a CodeParameterDeclarationExpression array.
collection.CopyTo( parameters, 0 );
' Copies the contents of the collection beginning at index 0 to the specified CodeParameterDeclarationExpression array.
' 'parameters' is a CodeParameterDeclarationExpression array.
collection.CopyTo(parameters, 0)

適用於

另請參閱