CodeDirectiveCollection.CopyTo(CodeDirective[], Int32) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컬렉션의 내용을 지정된 인덱스에서 시작하는 1차원 배열에 복사합니다.
public:
void CopyTo(cli::array <System::CodeDom::CodeDirective ^> ^ array, int index);
public void CopyTo(System.CodeDom.CodeDirective[] array, int index);
member this.CopyTo : System.CodeDom.CodeDirective[] * int -> unit
Public Sub CopyTo (array As CodeDirective(), index As Integer)
매개 변수
- array
- CodeDirective[]
컬렉션에서 복사된 값의 대상인 형식 CodeDirective 의 배열입니다.
- index
- Int32
컬렉션 개체 삽입을 시작할 배열의 인덱스입니다.
예외
대상 배열은 다차원입니다.
-또는-
지정된 대상 배열의 인덱스와 대상 배열 index 의 끝 사이의 사용 가능한 공간보다 큰 요소 CodeDirectiveCollection 수입니다.
array은 null입니다.
index 가 대상 배열의 최소 인덱스보다 작습니다.
예제
다음 코드 예제에서는 인덱스 0에서 시작 하는 컬렉션의 콘텐츠를 지정 된 CodeDirective 배열에 복사 하는 메서드의 사용을 CopyTo 보여 줍니다. 이 예제는 클래스에 제공된 더 큰 예제의 CodeDirectiveCollection 일부입니다.
// Copies the contents of the collection beginning at index 0 to the specified CodeDirective array.
// 'directives' is a CodeDirective array.
collection.CopyTo(directives, 0);
' Copies the contents of the collection beginning at index 0 to the specified CodeDirective array.
' 'directives' is a CodeDirective array.
collection.CopyTo(directives, 0)