ServiceDescriptionFormatExtensionCollection.CopyTo(Object[], Int32) 方法

定义

将整个 ServiceDescriptionFormatExtensionCollection 复制到 ServiceDescriptionFormatExtension 类型的一维数组中(从目标数组的指定的从零开始的索引处开始)。

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)

参数

array
Object[]

作为复制操作目标的 ServiceDescriptionFormatExtension 类型的数组。

index
Int32

将在该处开始放置所复制的集合的从零开始的索引。

示例

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

适用于