CodeAttributeArgumentCollection.CopyTo(CodeAttributeArgument[], Int32) Метод

Определение

Копирует объекты коллекции в одномерный экземпляр Array, начинающийся с указанного индекса.

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

Параметры

array
CodeAttributeArgument[]

Одномерный объект Array, являющийся целевым для значений, скопированных из коллекции.

index
Int32

Индекс в массиве, с позиции которого требуется начать вставку.

Исключения

Массив назначения является многомерным.

-или-

Количество элементов в CodeAttributeArgumentCollection превышает доступное пространство между индексом конечного массива, указанного параметром index, и концом конечного массива.

Параметр array имеет значение null.

Параметр index меньше, чем минимальный индекс целевого массива.

Примеры

В следующем примере показано, как скопировать содержимое объекта в CodeAttributeArgumentCollection массив, начинающийся CodeAttributeArgument с указанного значения индекса.

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

Применяется к