ImportCollection.Contains(Import) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した Import が ImportCollection のメンバーかどうかを示す値を返します。
public:
bool Contains(System::Web::Services::Description::Import ^ import);
public bool Contains (System.Web.Services.Description.Import import);
member this.Contains : System.Web.Services.Description.Import -> bool
Public Function Contains (import As Import) As Boolean
パラメーター
戻り値
import
パラメーターが ImportCollection のメンバーである場合は true
。それ以外の場合は false
。
例
Contains
メソッドの使用例を次に示します。
// Get Import by Index.
Import^ myImport = myServiceDescription->Imports[ myServiceDescription->Imports->Count - 1 ];
Console::WriteLine( "Import by Index..." );
if ( myImportCollection->Contains( myImport ) )
{
Console::WriteLine( "Import Namespace ' {0} ' is found in 'ImportCollection'.", myImport->Namespace );
Console::WriteLine( "Index of '{0}' in 'ImportCollection' = {1}",
myImport->Namespace, myImportCollection->IndexOf( myImport ) );
Console::WriteLine( "Deleting Import from 'ImportCollection'..." );
myImportCollection->Remove( myImport );
if ( myImportCollection->IndexOf( myImport ) == -1 )
Console::WriteLine( "Import is successfully removed from Import Collection." );
}
// Get Import by Index.
Import myImport = myServiceDescription.Imports[myServiceDescription.Imports.Count-1];
Console.WriteLine("Import by Index...");
if (myImportCollection.Contains(myImport))
{
Console.WriteLine("Import Namespace '"
+ myImport.Namespace + "' is found in 'ImportCollection'.");
Console.WriteLine("Index of '" + myImport.Namespace + "' in 'ImportCollection' = "
+ myImportCollection.IndexOf(myImport));
Console.WriteLine("Deleting Import from 'ImportCollection'...");
myImportCollection.Remove(myImport);
if(myImportCollection.IndexOf(myImport) == -1)
Console.WriteLine("Import is successfully removed from Import Collection.");
}
' Get Import by Index.
Dim myImport As Import = _
myServiceDescription.Imports(myServiceDescription.Imports.Count - 1)
Console.WriteLine("Import by Index...")
If myImportCollection.Contains(myImport) Then
Console.WriteLine("Import Namespace '" + myImport.Namespace + _
"' is found in 'ImportCollection'.")
Console.WriteLine("Index of '" + myImport.Namespace + _
"' in 'ImportCollection' = " + _
myImportCollection.IndexOf(myImport).ToString())
Console.WriteLine("Delete Import from 'ImportCollection'...")
myImportCollection.Remove(myImport)
If myImportCollection.IndexOf(myImport) = - 1 Then
Console.WriteLine("Import is successfully removed from Import Collection.")
End If