DesignerActionListCollection.CopyTo(DesignerActionList[], Int32) 方法

定义

将当前集合的元素复制到提供的数组,从指定的数组索引开始。Copies the elements of the current collection into the supplied array, starting at the specified array index.

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

参数

array
DesignerActionList[]

DesignerActionList 类型的一维数组,它是从当前集合复制的元素的目标数组。The one-dimensional array of type DesignerActionList that is the destination of the elements copied from the current collection. 该数组的索引必须从零开始。The array must have zero-based indexing.

index
Int32

array 中从零开始的索引,从此处开始复制。The zero-based index in array at which copying begins.

例外

arraynullarray is null.

index 小于 0。index is less than 0.

array 是多维的。array is multidimensional.

- 或 --or- 当前集合中的元素数目大于从 index 到目标数组的末尾的可用空间。The number of elements in the current collection is greater than the available space from index to the end of the destination array.

将当前集合的元素强制转换为目标数组的类型时发生问题,可能是由于失败的向下转换造成的。A problem occurred casting the elements of the current collection to the type of the destination array, perhaps as the result of a failed downcast.

注解

如果在 CopyTo 复制时方法引发异常,则目标数组的状态为 undefined。If the CopyTo method throws an exception while copying, the state of the destination array is undefined. 例如,如果 ArgumentExceptionInvalidCastException 发生,则目标数组可能会处于部分填充状态。For example, if an ArgumentException or InvalidCastException occurs, the destination array may be left in a partially filled state.

适用于

另请参阅