CodeCommentStatementCollection.CopyTo(CodeCommentStatement[], Int32) Metod

Definition

Kopierar samlingsobjekten till den angivna endimensionella Array med början vid det angivna indexet.

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

Parametrar

array
CodeCommentStatement[]

Den endimensionella Array som är målet för de värden som kopieras från samlingen.

index
Int32

Indexet för matrisen som ska börja infogas.

Undantag

Målmatrisen är flerdimensionell.

-eller-

Antalet element i CodeCommentStatementCollection är större än det tillgängliga utrymmet mellan indexet för målmatrisen som anges av parametern index och slutet av målmatrisen.

Parametern array är null.

Parametern index är mindre än målmatrisens minsta index.

Exempel

I följande exempel visas hur du kopierar innehållet i en CodeCommentStatementCollection till en matris med början vid indexvärdet 0.

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

Gäller för

Se även