ServiceDescriptionCollection.Contains Method (ServiceDescription)

 

Returns a value indicating whether the specified ServiceDescription is a member of the collection.

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

Public Function Contains (
	serviceDescription As ServiceDescription
) As Boolean

Parameters

serviceDescription
Type: System.Web.Services.Description.ServiceDescription

The ServiceDescription for which to check collection membership.

Return Value

Type: System.Boolean

true if the serviceDescription parameter is a member of the ServiceDescriptionCollection; otherwise, false.

' Check for 'ServiceDescription' object in the collection.
If myCollection.Contains(myServiceDescription2) Then
   ' Get the index of 'ServiceDescription' object.
   Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)
   ' Remove 'ServiceDescription' object from the collection.
   myCollection.Remove(myServiceDescription2)
   Console.WriteLine("Element at index {0} is removed ", myIndex.ToString())
Else
   Console.WriteLine("Element not found.")
End If

.NET Framework
Available since 1.1
Return to top
Show: