Compartir vía


OperationMessageCollection.CopyTo(OperationMessage[], Int32) Método

Definición

Copia todo el objeto OperationMessageCollection en una matriz unidimensional compatible de tipo OperationMessage, a partir del índice de base cero especificado de la matriz de destino.

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

Parámetros

array
OperationMessage[]

Matriz de tipo OperationMessage que actúa como destino de la acción de copia.

index
Int32

Índice de base cero en el que se comienza a insertar la colección copiada.

Ejemplos

array<OperationMessage^>^myCollection = gcnew array<OperationMessage^>(myOperationMessageCollection->Count);
myOperationMessageCollection->CopyTo( myCollection, 0 );
Console::WriteLine( "Operation name(s) :" );
for ( int i = 0; i < myCollection->Length; i++ )
{
   Console::WriteLine( " {0}", myCollection[ i ]->Operation->Name );
}
OperationMessage[] myCollection =
   new OperationMessage[myOperationMessageCollection.Count];
myOperationMessageCollection.CopyTo(myCollection, 0);
Console.WriteLine("Operation name(s) :");
for (int i = 0; i < myCollection.Length ; i++)
{
   Console.WriteLine(" " + myCollection[i].Operation.Name);
}
Dim myCollection(myOperationMessageCollection.Count -1 ) _
   As OperationMessage
myOperationMessageCollection.CopyTo(myCollection, 0)
Console.WriteLine("Operation name(s) :")
Dim i As Integer
For i = 0 To myCollection.Length - 1
   Console.WriteLine(" " & myCollection(i).Operation.Name)
Next i

Se aplica a