This documentation is archived and is not being maintained.

OperationMessageCollection.CopyTo Method

Copies the entire OperationMessageCollection to a compatible one-dimensional array of type OperationMessage, starting at the specified zero-based index of the target array.

[Visual Basic]
Public Sub CopyTo( _
   ByVal array() As OperationMessage, _
   ByVal index As Integer _
)
[C#]
public void CopyTo(
 OperationMessage[] array,
 int index
);
[C++]
public: void CopyTo(
 OperationMessage* array[],
 int index
);
[JScript]
public function CopyTo(
   array : OperationMessage[],
 index : int
);

Parameters

array
An array of type OperationMessage serving as the destination for the copy action.
index
The zero-based index at which to start placing the copied collection.

Example

[Visual Basic] 
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


[C#] 
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);
}


[C++] 
OperationMessage* myCollection[] = 
   new OperationMessage*[myOperationMessageCollection->Count];
myOperationMessageCollection->CopyTo(myCollection, 0);
Console::WriteLine(S"Operation name(s) :");
for (int i = 0; i < myCollection->Length ; i++)
{
   Console::WriteLine(S" {0}", myCollection[i]->Operation->Name);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

OperationMessageCollection Class | OperationMessageCollection Members | System.Web.Services.Description Namespace

Show: