ServiceDescriptionFormatExtensionCollection.CopyTo(Object[], Int32) Metoda

Definicja

Kopiuje całą ServiceDescriptionFormatExtensionCollection do jednowymiarowej tablicy typu ServiceDescriptionFormatExtension, zaczynając od określonego indeksu zerowego tablicy docelowej.

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)

Parametry

array
Object[]

Tablica typu ServiceDescriptionFormatExtension pełniąca rolę miejsca docelowego akcji kopiowania.

index
Int32

Indeks oparty na zerach, na którym należy rozpocząć umieszczanie skopiowanej kolekcji.

Przykłady

// 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.")

Dotyczy