This documentation is archived and is not being maintained.

OperationMessageCollection.Contains Method

Returns a value indicating whether the specified OperationMessage is a member of the OperationMessageCollection.

[Visual Basic]
Public Function Contains( _
   ByVal operationMessage As OperationMessage _
) As Boolean
[C#]
public bool Contains(
 OperationMessage operationMessage
);
[C++]
public: bool Contains(
 OperationMessage* operationMessage
);
[JScript]
public function Contains(
   operationMessage : OperationMessage
) : Boolean;

Parameters

operationMessage
The OperationMessage for which to check collection membership.

Return Value

true if the operationMessage parameter is a member of the OperationMessageCollection; otherwise, false.

Example

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

[C#] 
if(myOperationMessageCollection.Contains(myOperationMessage) 
   == true )
{
   int myIndex =
      myOperationMessageCollection.IndexOf(myOperationMessage);
   Console.WriteLine(" The index of the Add operation " +
      "message in the collection is : " + myIndex);
}

[C++] 
if(myOperationMessageCollection->Contains(myOperationMessage) 
   == true )
{
   int myIndex =
      myOperationMessageCollection->IndexOf(myOperationMessage);
   Console::WriteLine(S" The index of the Add operation message in the collection is : {0}", __box(myIndex));
}

[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: