CodeAttributeDeclarationCollection.CopyTo 메서드

정의

지정한 인덱스에서 시작하는 1차원 Array 인스턴스에 컬렉션 개체를 복사합니다.

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

매개 변수

array
CodeAttributeDeclaration[]

컬렉션에서 복사된 값의 대상인 1차원 Array입니다.

index
Int32

삽입을 시작할 배열의 인덱스입니다.

예외

대상 배열이 다차원 배열인 경우

또는 CodeAttributeDeclarationCollection의 요소 수가 index 매개 변수에서 지정한 대상 배열 인덱스와 대상 배열 끝 사이의 사용 가능한 공간보다 큰 경우

array 매개 변수가 null인 경우

index 매개 변수가 대상 배열의 최소 인덱스보다 작은 경우

예제

다음 예제에서는 인덱스 0부터 배열에 콘텐츠를 CodeAttributeDeclarationCollection 복사하는 방법을 보여 줍니다.

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

적용 대상

추가 정보