OperationBindingCollection.Insert(Int32, OperationBinding) Метод

Определение

Добавляет заданный экземпляр OperationBinding в коллекцию OperationBindingCollection по указанному индексу (отсчитываемому с нуля).

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)

Параметры

index
Int32

Индекс (с нуля) места вставки параметра bindingOperation.

bindingOperation
OperationBinding

Параметр OperationBinding для добавления в коллекцию.

Примеры

В следующем примере иллюстрируется использование метода 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())

Комментарии

Если количество элементов в коллекции уже равно емкости коллекции, емкость удваивается путем автоматического перераспределения внутреннего массива до вставки нового элемента.

index Если параметр равен Count, bindingOperation параметр добавляется в конец OperationBindingCollection.

Элементы после точки вставки перемещаются вниз для размещения нового элемента.

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