ImportCollection.Insert(Int32, Import) Metod

Definition

Lägger till den angivna Import instansen ImportCollection i det angivna nollbaserade indexet.

public:
 void Insert(int index, System::Web::Services::Description::Import ^ import);
public void Insert(int index, System.Web.Services.Description.Import import);
member this.Insert : int * System.Web.Services.Description.Import -> unit
Public Sub Insert (index As Integer, import As Import)

Parametrar

index
Int32

Det nollbaserade index där parametern ska infogas import .

import
Import

Att Import lägga till i samlingen.

Undantag

Parametern index är mindre än noll.

-eller-

Parametern index är större än Count.

Exempel

I följande exempel visas användningen av metoden Insert. Information om hur du visar källan för den användardefinierade CreateImport metoden finns i exemplet som ingår i Import klassen.

myServiceDescription = ServiceDescription::Read( "StockQuoteService_cpp.wsdl" );
myServiceDescription->Imports->Insert( 0, CreateImport( "http://localhost/stockquote/definitions", "http://localhost/stockquote/stockquote_cpp.wsdl" ) );
myServiceDescription =
   ServiceDescription.Read("StockQuoteService_cs.wsdl");
myServiceDescription.Imports.Insert(
   0,CreateImport("http://localhost/stockquote/definitions",
   "http://localhost/stockquote/stockquote_cs.wsdl"));
  myServiceDescription = _
     ServiceDescription.Read("StockQuoteService_vb.wsdl")
myServiceDescription.Imports.Insert(0, _
   CreateImport("http://localhost/stockquote/definitions", _
   "http://localhost/stockquote/stockquote_vb.wsdl"))

Kommentarer

Om antalet objekt i samlingen redan är lika med samlingens kapacitet, fördubblas kapaciteten genom att den interna matrisen omplaceras automatiskt innan det nya elementet infogas.

Om parametern index är lika med Countläggs parametern import till i slutet av ImportCollection.

Elementen efter insättningspunkten flyttas ned för att rymma det nya elementet.

Gäller för