Compartir a través de


OperationBindingCollection.Insert(Int32, OperationBinding) Método

Definición

Agrega la instancia de OperationBinding especificada al objeto OperationBindingCollection en el índice de base cero especificado.

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

Parámetros

index
Int32

Índice de base cero donde se inserta el parámetro bindingOperation.

bindingOperation
OperationBinding

OperationBinding que se agrega a la colección.

Ejemplos

En el siguiente ejemplo se muestra el uso del método Insert.

// Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection->Insert( 0, addOperationBinding );
Console::WriteLine( "\nInserted the OperationBinding of the "
"Add operation in the collection." );

// Get the index of the OperationBinding of the Add
// operation from the collection.
int index = myOperationBindingCollection->IndexOf( addOperationBinding );
Console::WriteLine( "\nThe index of the OperationBinding of the Add operation : {0}", index );
// Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection.Insert(0, addOperationBinding);
Console.WriteLine("\nInserted the OperationBinding of the " +
   "Add operation in the collection.");

// Get the index of the OperationBinding of the Add
// operation from the collection.
int index = myOperationBindingCollection.IndexOf(addOperationBinding);
Console.WriteLine("\nThe index of the OperationBinding of the " +
   "Add operation : " + index);
' Insert the OperationBinding of the Add operation at index 0.
myOperationBindingCollection.Insert(0, addOperationBinding)
Console.WriteLine(ControlChars.NewLine & _
   "Inserted the OperationBinding of the " & _
   "Add operation in the collection.")

' Get the index of the OperationBinding of the Add
' operation from the collection.
Dim index As Integer = myOperationBindingCollection.IndexOf( _
   addOperationBinding)
Console.WriteLine(ControlChars.NewLine & _
   "The index of the OperationBinding of the " & _
   "Add operation : " & index.ToString())

Comentarios

Si el número de elementos de la colección ya es igual a la capacidad de la colección, la capacidad se duplica mediante la reasignación automática de la matriz interna antes de insertar el nuevo elemento.

Si el index parámetro es igual a Count, el bindingOperation parámetro se agrega al final de OperationBindingCollection.

Los elementos después del punto de inserción se mueven hacia abajo para acomodar el nuevo elemento.

Se aplica a