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