次の方法で共有


ServiceCollection.Item プロパティ (Int32)

指定の 0 から始まるインデックス番号に対応する Service の値を取得または設定します。

[C#] C# では、このプロパティは ServiceCollection クラスのインデクサになります。

Overloads Public Default Property Item( _
   ByVal index As Integer _) As Service
[C#]
public Service this[intindex] {get; set;}
[C++]
public: __property Service* get_Item(intindex);public: __property void set_Item(intindex,   Service*);
[JScript]
returnValue = ServiceCollectionObject.Item(index);ServiceCollectionObject.Item(index) = returnValue;またはreturnValue = ServiceCollectionObject(index);ServiceCollectionObject(index) = returnValue;

[JScript] JScript では、この型で定義されている既定のインデックス プロパティを使用することができます。しかし、独自のインデックス プロパティを明示的に定義することはできません。ただし、このクラスの expando 属性を指定すると、既定のインデックス プロパティが提供されます。提供されるインデックス プロパティの型は Object 型であり、インデックス型は String になります。

引数 [JScript]

  • index
    変更または返される Service の、0 から始まるインデックス番号。

パラメータ [Visual Basic, C#, C++]

  • index
    変更または返される Service の、0 から始まるインデックス番号。

プロパティ値

Service

使用例

 
' Read a ServiceDescription from existing WSDL.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

[C#] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);

[C++] 
// Read a ServiceDescription from existing WSDL.
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"Input_CS.wsdl");
myServiceDescription->TargetNamespace = S"http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection* myServiceCollection = myServiceDescription->Services;

// Remove the Service at index 0 of the collection.
myServiceCollection->Remove(myServiceDescription->Services->Item[0]);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ServiceCollection クラス | ServiceCollection メンバ | System.Web.Services.Description 名前空間 | ServiceCollection.Item オーバーロードの一覧