次の方法で共有


OperationCollection.IndexOf メソッド

指定した Operation を検索し、コレクション内で最初に見つかった位置の 0 から始まるインデックス番号を返します。

Public Function IndexOf( _
   ByVal operation As Operation _) As Integer
[C#]
public int IndexOf(Operationoperation);
[C++]
public: int IndexOf(Operation* operation);
[JScript]
public function IndexOf(
   operation : Operation) : int;

パラメータ

  • operation
    コレクション内での検索対象となる Operation

戻り値

32 ビット符号付き整数。

使用例

[Visual Basic, C#, C++] IndexOf メソッドを使用する例を次に示します。

 
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

[C#] 
if(myOperationCollection.Contains(myOperation) == true)
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}

[C++] 
if(myOperationCollection->Contains(myOperation) == true)
{
   Console::WriteLine(S"The index of the added 'myOperation' operation is : {0}",
      __box(myOperationCollection->IndexOf(myOperation)));
}

[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 ファミリ

参照

OperationCollection クラス | OperationCollection メンバ | System.Web.Services.Description 名前空間