Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Entfernt das erste Vorkommen des angegebenen Import aus der ImportCollection.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Syntax
'Declaration
Public Sub Remove ( _
import As Import _
)
'Usage
Dim instance As ImportCollection
Dim import As Import
instance.Remove(import)
public void Remove (
Import import
)
public:
void Remove (
Import^ import
)
public void Remove (
Import import
)
public function Remove (
import : Import
)
Parameter
- import
Der aus der Auflistung zu entfernende Import.
Hinweise
Diese Methode führt eine lineare Suche aus. Die durchschnittliche Ausführungszeit ist somit proportional zu Count.
Die Elemente, die auf den entfernten Import folgen, werden nach oben verschoben, um die frei gewordene Stelle einzunehmen.
Beispiel
Das folgende Beispiel veranschaulicht die Verwendung der Remove-Methode.
' 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
// 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.
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.get_Imports().
get_Item(myServiceDescription.get_Imports().get_Count() - 1);
Console.WriteLine("Import by Index...");
if (myImportCollection.Contains(myImport)) {
Console.WriteLine("Import Namespace '" + myImport.get_Namespace()
+ "' is found in 'ImportCollection'.");
Console.WriteLine("Index of '" + myImport.get_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.");
}
}
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ImportCollection-Klasse
ImportCollection-Member
System.Web.Services.Description-Namespace