Compartilhar via


ServiceDescriptionFormatExtensionCollection.CopyTo(Object[], Int32) Método

Definição

Copia todo o ServiceDescriptionFormatExtensionCollection para uma matriz unidimensional do tipo ServiceDescriptionFormatExtension, começando no índice de base zero especificado da matriz de destino.

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

Parâmetros

array
Object[]

Uma matriz do tipo ServiceDescriptionFormatExtension que funciona como o destino da ação de cópia.

index
Int32

O índice de base zero no qual começar a posicionar a coleção copiada.

Exemplos

// Copy elements of collection to an Object array.
array<Object^>^myObjectArray2 = gcnew array<Object^>(myCollection->Count);
myCollection->CopyTo( myObjectArray2, 0 );
Console::WriteLine( "Collection elements are copied to an object array." );
// Copy elements of collection to an Object array.
Object[] myObjectArray2 = new Object[myCollection.Count];
myCollection.CopyTo(myObjectArray2,0);
Console.WriteLine("Collection elements are copied to an object array.");
' Copy elements of collection to an Object array.
Dim myObjectArray2(myCollection.Count -1 ) As Object
myCollection.CopyTo(myObjectArray2, 0)
Console.WriteLine("Collection elements are copied to an object array.")

Aplica-se a