OperationMessageCollection.IndexOf(OperationMessage) Yöntem

Tanım

Belirtilen OperationMessage öğesini arar ve koleksiyondaki ilk oluşumun sıfır tabanlı dizinini döndürür.

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

Parametreler

operationMessage
OperationMessage

OperationMessage Koleksiyonda aranacak olan.

Döndürülenler

Int32

Belirtilen işlem iletisinin sıfır tabanlı dizini veya öğe koleksiyonda bulunamadıysa -1.

Örnekler

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

Şunlara uygulanır