OperationBindingCollection.Insert(Int32, OperationBinding) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Adiciona a instância especificada OperationBinding ao OperationBindingCollection no índice baseado em zero 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
O índice baseado em zero a partir do qual inserir o bindingOperation parâmetro.
- bindingOperation
- OperationBinding
A OperationBinding acrescentar à coleção.
Exemplos
O exemplo a seguir demonstra o uso do Insert método.
// 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())
Observações
Se o número de itens na coleção já for igual à capacidade da coleção, a capacidade é duplicada ao realocar automaticamente o array interno antes de o novo elemento ser inserido.
Se o index parâmetro for igual a Count, o bindingOperation parâmetro é adicionado ao final do OperationBindingCollection.
Os elementos após o ponto de inserção descem para acomodar o novo elemento.