TextElementCollection<TextElementType>.CopyTo(TextElementType[], Int32) 方法

定义

复制集合的内容并插入到指定数组中,从数组中指定的索引位置开始插入。Copies the contents of the collection and inserts them into a specified array starting at a specified index position in the array.

public:
 virtual void CopyTo(cli::array <TextElementType> ^ array, int arrayIndex);
public void CopyTo (TextElementType[] array, int arrayIndex);
abstract member CopyTo : 'extElementType[] * int -> unit
override this.CopyTo : 'extElementType[] * int -> unit
Public Sub CopyTo (array As TextElementType(), arrayIndex As Integer)

参数

array
TextElementType[]

集合内容将要复制到的一维数组。A one-dimensional array to which the collection contents will be copied. 此数组必须使用从零开始的索引。This array must use zero-based indexing.

arrayIndex
Int32

array 中从零开始的索引,指定插入复制的集合对象的开始位置。A zero-based index in array specifying the position at which to begin inserting the copied collection objects.

实现

例外

array 中包括与 TextElement 类型不相符的项时,或 arrayIndex 指定的位置超出 array 的边界时引发。Raised when array includes items that are not compatible with the type TextElement, or if arrayIndex specifies a position that falls outside of the bounds of array.

array 为 null 时引发。Raised when array is null.

arrayIndex 小于 0 时引发。Raised when arrayIndex is less than 0.

适用于