다음을 통해 공유


OperationMessageCollection.IndexOf(OperationMessage) 메서드

정의

컬렉션에서 지정된 OperationMessage을 검색하여 처음 나오는 항목의 인덱스(0부터 시작)를 반환합니다.

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

매개 변수

operationMessage
OperationMessage

컬렉션에서 검색할 OperationMessage입니다.

반환

지정된 작업 메시지의 인덱스(0부터 시작)이거나, 해당 요소가 컬렉션에 없으면 -1입니다.

예제

if ( myOperationMessageCollection->Contains( myOperationMessage ) == true )
{
   int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage );
   Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex );
}
if(myOperationMessageCollection.Contains(myOperationMessage)
   == true )
{
   int myIndex =
      myOperationMessageCollection.IndexOf(myOperationMessage);
   Console.WriteLine(" The index of the Add operation " +
      "message in the collection is : " + myIndex);
}
If myOperationMessageCollection.Contains(myOperationMessage) _
   = True Then
   Dim myIndex As Integer = _
      myOperationMessageCollection.IndexOf(myOperationMessage)
   Console.WriteLine(" The index of the Add operation " & _
       "message in the collection is : " & myIndex.ToString())
End If

적용 대상