AutomationElementCollection.CopyTo 메서드

정의

컬렉션의 요소를 배열로 복사하며, 대상 배열에서 지정한 인덱스부터 저장합니다.

오버로드

CopyTo(Array, Int32)

컬렉션의 요소를 배열로 복사하며, 대상 배열에서 지정한 인덱스부터 저장합니다.

CopyTo(AutomationElement[], Int32)

컬렉션의 요소를 특수화된 배열 인스턴스로 복사하며, 대상 배열에서 지정한 인덱스부터 저장합니다.

CopyTo(Array, Int32)

컬렉션의 요소를 배열로 복사하며, 대상 배열에서 지정한 인덱스부터 저장합니다.

public:
 virtual void CopyTo(Array ^ array, int index);
public virtual void CopyTo (Array array, int index);
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Overridable Sub CopyTo (array As Array, index As Integer)

매개 변수

array
Array

컬렉션에서 복사한 요소가 저장될 대상입니다.

index
Int32

대상 배열에서 복사를 시작할 인덱스(0부터 시작)입니다.

구현

예제

다음 예제에서는 복사 하는 방법을 보여 줍니다는 AutomationElementCollection 를 개체의 배열입니다.

// elementCollection is an AutomationElementCollection.
object[] elementUntypedArray = new object[elementCollection.Count];
elementCollection.CopyTo(elementUntypedArray, 0);
' elementCollection is an AutomationElementCollection.
Dim elementUntypedArray(elementCollection.Count) As Object
elementCollection.CopyTo(elementUntypedArray, 0)

적용 대상

CopyTo(AutomationElement[], Int32)

컬렉션의 요소를 특수화된 배열 인스턴스로 복사하며, 대상 배열에서 지정한 인덱스부터 저장합니다.

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

매개 변수

array
AutomationElement[]

컬렉션에서 복사한 요소가 저장될 대상입니다.

index
Int32

대상 배열에서 복사를 시작할 인덱스(0부터 시작)입니다.

예외

대상 배열이 너무 작거나 index가 배열의 범위에서 벗어난 경우

예제

다음 예제에서는 복사 하는 방법을 보여 줍니다는 AutomationElementCollection 배열의 AutomationElement 개체입니다.

// elementCollection is an AutomationElementCollection.
AutomationElement[] elementArray = new AutomationElement[elementCollection.Count];
elementCollection.CopyTo(elementArray, 0);
' elementCollection is an AutomationElementCollection.
Dim elementArray(elementCollection.Count) As AutomationElement
elementCollection.CopyTo(elementArray, 0)

적용 대상