Share via


OperationCollection.IndexOf(Operation) メソッド

定義

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

public:
 int IndexOf(System::Web::Services::Description::Operation ^ operation);
public int IndexOf (System.Web.Services.Description.Operation operation);
member this.IndexOf : System.Web.Services.Description.Operation -> int
Public Function IndexOf (operation As Operation) As Integer

パラメーター

operation
Operation

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

戻り値

32 ビット符号付き整数。

IndexOf メソッドの使用例を次に示します。

if ( myOperationCollection->Contains( myOperation ) == true )
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if(myOperationCollection.Contains(myOperation) == true)
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

適用対象