Share via


ImportCollection.Insert(Int32, Import) メソッド

定義

指定した 0 から始まるインデックス番号にある Import に、指定した ImportCollection インスタンスを追加します。

public:
 void Insert(int index, System::Web::Services::Description::Import ^ import);
public void Insert (int index, System.Web.Services.Description.Import import);
member this.Insert : int * System.Web.Services.Description.Import -> unit
Public Sub Insert (index As Integer, import As Import)

パラメーター

index
Int32

import パラメーターを挿入する位置の、0 から始まるインデックス番号。

import
Import

コレクションに追加する Import

例外

index パラメーターが 0 未満。

- または -

index パラメーターが Count より大きい値です。

Insert メソッドの使用例を次に示します。 ユーザー定義 CreateImport メソッドのソースを表示するには、 クラスに含まれている例を Import 参照してください。

myServiceDescription = ServiceDescription::Read( "StockQuoteService_cpp.wsdl" );
myServiceDescription->Imports->Insert( 0, CreateImport( "http://localhost/stockquote/definitions", "http://localhost/stockquote/stockquote_cpp.wsdl" ) );
myServiceDescription =
   ServiceDescription.Read("StockQuoteService_cs.wsdl");
myServiceDescription.Imports.Insert(
   0,CreateImport("http://localhost/stockquote/definitions",
   "http://localhost/stockquote/stockquote_cs.wsdl"));
  myServiceDescription = _
     ServiceDescription.Read("StockQuoteService_vb.wsdl")
myServiceDescription.Imports.Insert(0, _
   CreateImport("http://localhost/stockquote/definitions", _
   "http://localhost/stockquote/stockquote_vb.wsdl"))

注釈

コレクション内の項目の数が既にコレクションの容量と等しい場合、新しい要素が挿入される前に内部配列を自動的に再割り当てすることで、容量が 2 倍になります。

パラメーターが indexCount等しい場合、 import パラメーターは の末尾に ImportCollection追加されます。

挿入ポイントの後の要素は、新しい要素に合わせて下に移動します。

適用対象