CompilerErrorCollection.CopyTo(CompilerError[], Int32) メソッド

定義

指定したインデックス位置にある 1 次元 Array インスタンスにコレクション値をコピーします。

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

パラメーター

array
CompilerError[]

Arrayからコピーされた値のコピー先となる 1 次元CompilerErrorCollection

index
Int32

コピーを開始する配列内のインデックス。

例外

array パラメーターによって示される配列は多次元です。

-又は-

CompilerErrorCollection内の要素の数が、indexarrayで示される配列の末尾の間の使用可能な領域を超えています。

array パラメーターはnull

index パラメーターは、array パラメーターによって示される配列の下限未満です。

次の例では、 CopyTo メソッドを使用して、指定したインデックス値から始まる CompilerErrorCollection の内容を配列にコピーする方法を示します。

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

適用対象

こちらもご覧ください