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

定義

指定した Import インスタンスを、指定した 0 から始まるインデックス位置にある 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 倍になります。

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

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

適用対象