Share via


CodeTypeReferenceCollection.CopyTo(CodeTypeReference[], Int32) 方法

定義

將集合中的項目複製到指定索引處指定的一維 Array

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

參數

array
CodeTypeReference[]

一維 Array,是從集合複製之值的目的端。

index
Int32

要開始插入的陣列索引。

例外狀況

array 是多維參數。

-或-

CodeTypeReferenceCollection 中的元素數目大於由 index 參數指定的目標陣列索引和目標陣列結尾之間的可用空間。

array 參數為 null

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

範例

// Copies the contents of the collection, beginning at index 0, 
// to the specified CodeTypeReference array.
// 'references' is a CodeTypeReference array.
collection->CopyTo( references, 0 );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeTypeReference array.
// 'references' is a CodeTypeReference array.
collection.CopyTo( references, 0 );
' Copies the contents of the collection, beginning at index 0, 
' to the specified CodeTypeReference array.
' 'references' is a CodeTypeReference array.
collection.CopyTo(references, 0)

適用於

另請參閱