OperationBindingCollection.Insert Method
Adds the specified OperationBinding instance to the OperationBindingCollection at the specified zero-based index.
[Visual Basic] Public Sub Insert( _ ByVal index As Integer, _ ByVal bindingOperation As OperationBinding _ ) [C#] public void Insert( int index, OperationBinding bindingOperation ); [C++] public: void Insert( int index, OperationBinding* bindingOperation ); [JScript] public function Insert( index : int, bindingOperation : OperationBinding );
Parameters
- index
- The zero-based index at which to insert the bindingOperation parameter.
- bindingOperation
- The OperationBinding to add to the collection.
Remarks
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.
If the index parameter is equal to Count, the bindingOperation parameter is added to the end of the OperationBindingCollection.
The elements after the insertion point move down to accommodate the new element.
Example
[Visual Basic, C#, C++] The following example demonstrates the use of the Insert method.
[Visual Basic] ' 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()) [C#] // 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); [C++] // Insert the OperationBinding of the Add operation at index 0. myOperationBindingCollection->Insert(0, addOperationBinding); Console::WriteLine(S"\nInserted the OperationBinding of the " S"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(S"\nThe index of the OperationBinding of the Add operation : {0}", __box(index));
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
OperationBindingCollection Class | OperationBindingCollection Members | System.Web.Services.Description Namespace