Edit

Bagikan melalui


OperationMessageCollection.IndexOf(OperationMessage) Method

Definition

Searches for the specified OperationMessage and returns the zero-based index of the first occurrence within the collection.

public:
 int IndexOf(System::Web::Services::Description::OperationMessage ^ operationMessage);
public int IndexOf (System.Web.Services.Description.OperationMessage operationMessage);
member this.IndexOf : System.Web.Services.Description.OperationMessage -> int
Public Function IndexOf (operationMessage As OperationMessage) As Integer

Parameters

operationMessage
OperationMessage

The OperationMessage for which to search in the collection.

Returns

The zero-based index of the specified operation message, or -1 if the element was not found in the collection.

Examples

if ( myOperationMessageCollection->Contains( myOperationMessage ) == true )
{
   int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage );
   Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex );
}
if(myOperationMessageCollection.Contains(myOperationMessage)
   == true )
{
   int myIndex =
      myOperationMessageCollection.IndexOf(myOperationMessage);
   Console.WriteLine(" The index of the Add operation " +
      "message in the collection is : " + myIndex);
}
If myOperationMessageCollection.Contains(myOperationMessage) _
   = True Then
   Dim myIndex As Integer = _
      myOperationMessageCollection.IndexOf(myOperationMessage)
   Console.WriteLine(" The index of the Add operation " & _
       "message in the collection is : " & myIndex.ToString())
End If

Applies to