ServiceDescriptionCollection.Contains(ServiceDescription) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した 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 。
返品
true
serviceDescription パラメーターがServiceDescriptionCollectionのメンバーである場合は a0/>。それ以外の場合は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