OperationMessageCollection::IndexOf Method (OperationMessage^)

 

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

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public:
int IndexOf(
	OperationMessage^ operationMessage
)

Parameters

operationMessage
Type: System.Web.Services.Description::OperationMessage^

The OperationMessage for which to search in the collection.

Return Value

Type: System::Int32

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

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 );
}

.NET Framework
Available since 1.1
Return to top
Show: