ImportCollection.IndexOf(Import) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컬렉션에서 지정된 Import을 검색하여 처음 나오는 항목의 인덱스(0부터 시작)를 반환합니다.
public:
int IndexOf(System::Web::Services::Description::Import ^ import);
public int IndexOf (System.Web.Services.Description.Import import);
member this.IndexOf : System.Web.Services.Description.Import -> int
Public Function IndexOf (import As Import) As Integer
매개 변수
반환
32비트 부호 있는 정수입니다.
예제
다음 예제에서는 IndexOf
메서드를 사용하는 방법을 보여 줍니다.
// 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