This documentation is archived and is not being maintained.

OperationCollection.Contains Method

Returns a value indicating whether the specified Operation is a member of the OperationCollection.

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

Parameters

operation
The Operation for which to check collection membership.

Return Value

true if operation is a member of the OperationCollection; otherwise, false.

Example

[Visual Basic, C#, C++] The following example demonstrates the use of the Contains method.

[Visual Basic] 
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

[C#] 
if(myOperationCollection.Contains(myOperation) == true)
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}

[C++] 
if(myOperationCollection->Contains(myOperation) == true)
{
   Console::WriteLine(S"The index of the added 'myOperation' operation is : {0}",
      __box(myOperationCollection->IndexOf(myOperation)));
}

[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

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

Show: