Поделиться через


ServiceCollection.Remove(Service) Метод

Определение

Удаляет первое вхождение указанного объекта Service из объекта ServiceCollection.

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

Параметры

service
Service

Объект Service, который требуется удалить из коллекции.

Примеры

// Read a ServiceDescription from existing WSDL.
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Input_CS.wsdl" );
myServiceDescription->TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection^ myServiceCollection = myServiceDescription->Services;

// Remove the Service at index 0 of the collection.
myServiceCollection->Remove( myServiceDescription->Services[ 0 ] );
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);
' Read a ServiceDescription from existing WSDL.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

Комментарии

Этот метод выполняет линейный поиск; Таким образом, среднее время выполнения пропорционально Count.

Элементы, следующие за удаленным Service , двигаются вверх, чтобы занять освобожденное место.

Применяется к