다음을 통해 공유


ImportCollection.Remove(Import) 메서드

정의

Import에서 맨 처음 발견되는 지정된 ImportCollection을 제거합니다.

public:
 void Remove(System::Web::Services::Description::Import ^ import);
public void Remove (System.Web.Services.Description.Import import);
member this.Remove : System.Web.Services.Description.Import -> unit
Public Sub Remove (import As Import)

매개 변수

import
Import

컬렉션에서 제거할 Import입니다.

예제

다음 예제에서는 Remove 메서드를 사용하는 방법을 보여 줍니다.

// 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

설명

이 메서드는; 선형 검색을 수행합니다. 따라서 평균 실행 시간에 비례 Count합니다.

제거 된 다음에 오는 요소 Import 위로 이동 하 여 빈된 지점을 차지 합니다.

적용 대상