OperationBindingCollection.Insert(Int32, OperationBinding) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
加入指定的 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 結尾。
插入點後的專案會向下移動以容納新的專案。