ServiceDescriptionCollection.Insert(Int32, ServiceDescription) Método

Definição

Adiciona a instância de ServiceDescription especificada ao ServiceDescriptionCollection no índice de base zero especificado.Adds the specified ServiceDescription instance to the ServiceDescriptionCollection at the specified zero-based index.

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)

Parâmetros

index
Int32

O índice de base zero no qual inserir o parâmetro serviceDescription.The zero-based index at which to insert the serviceDescription parameter.

serviceDescription
ServiceDescription

O ServiceDescription a adicionar à coleção.The ServiceDescription to add to the collection.

Exceções

O parâmetro index é menor que zero.The index parameter is less than zero.

- ou --or- O parâmetro index é maior que Count.The index parameter is greater than Count.

Exemplos

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

Comentários

Se o número de itens na coleção já for igual à capacidade da coleção, a capacidade será duplicada realocando automaticamente a matriz interna antes que o novo elemento seja inserido.If the number of items in the collection already equals the collection's capacity, the capacity is doubled by automatically reallocating the internal array before the new element is inserted.

Se o index parâmetro for igual a Count , o serviceDescription parâmetro será adicionado ao final do ServiceDescriptionCollection .If the index parameter is equal to Count, the serviceDescription parameter is added to the end of the ServiceDescriptionCollection.

Os elementos após o ponto de inserção se movem para baixo para acomodar o novo elemento.The elements after the insertion point move down to accommodate the new element.

Aplica-se a