다음을 통해 공유


ServiceDescriptionCollection.Contains(ServiceDescription) 메서드

정의

지정된 ServiceDescription이 컬렉션의 멤버인지 여부를 나타내는 값을 반환합니다.

public:
 bool Contains(System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public bool Contains (System.Web.Services.Description.ServiceDescription serviceDescription);
member this.Contains : System.Web.Services.Description.ServiceDescription -> bool
Public Function Contains (serviceDescription As ServiceDescription) As Boolean

매개 변수

serviceDescription
ServiceDescription

컬렉션 멤버인지 확인할 ServiceDescription입니다.

반환

Boolean

serviceDescription 매개 변수가 ServiceDescriptionCollection의 멤버이면 true이고, 그렇지 않으면 false입니다.

예제

// Check for 'ServiceDescription' object in the collection.
if (myCollection.Contains(myServiceDescription2))
{
   // Get the index of 'ServiceDescription' object.
   int myIndex = myCollection.IndexOf(myServiceDescription2);
   // Remove 'ServiceDescription' object from the collection.
   myCollection.Remove(myServiceDescription2);
   Console.WriteLine("Element at index {0} is removed ", myIndex);
}
else
{
   Console.WriteLine("Element not found.");
}
' 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

적용 대상