ServiceDescriptionCollection.Insert(Int32, ServiceDescription) Metod

Definition

Lägger till den angivna ServiceDescription instansen ServiceDescriptionCollection i det angivna nollbaserade indexet.

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

Parametrar

index
Int32

Det nollbaserade index där parametern ska infogas serviceDescription .

serviceDescription
ServiceDescription

Att ServiceDescription lägga till i samlingen.

Undantag

Parametern index är mindre än noll.

-eller-

Parametern index är större än Count.

Exempel

// Insert a ServiceDescription into the collection.
myCollection->Insert( 1, myServiceDescription2 );
// Insert a 'ServiceDescription' object into the collection.
myCollection.Insert(1, myServiceDescription2);
' Insert a 'ServiceDescription' object into the collection.
myCollection.Insert(1, myServiceDescription2)

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 serviceDescription till i slutet av ServiceDescriptionCollection.

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

Gäller för