OperationBindingCollection.Insert(Int32, OperationBinding) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee voegt u het opgegeven OperationBinding exemplaar toe aan de OperationBindingCollection opgegeven op nul gebaseerde index.
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)
Parameters
- index
- Int32
De op nul gebaseerde index waarop de bindingOperation parameter moet worden ingevoegd.
- bindingOperation
- OperationBinding
De OperationBinding toe te voegen aan de verzameling.
Voorbeelden
In het volgende voorbeeld ziet u het gebruik van de methode 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())
Opmerkingen
Als het aantal items in de verzameling al gelijk is aan de capaciteit van de verzameling, wordt de capaciteit verdubbeld door de interne matrix automatisch opnieuw te verplaatsen voordat het nieuwe element wordt ingevoegd.
Als de index parameter gelijk is aan Count, wordt de bindingOperation parameter toegevoegd aan het einde van de OperationBindingCollection.
De elementen na de invoegpositie gaan omlaag om het nieuwe element weer te geven.