Udostępnij za pośrednictwem


OperationMessageCollection.Contains(OperationMessage) Metoda

Definicja

Określa, czy określony OperationMessage element należy OperationMessageCollectiondo elementu .

public:
 bool Contains(System::Web::Services::Description::OperationMessage ^ operationMessage);
public bool Contains (System.Web.Services.Description.OperationMessage operationMessage);
member this.Contains : System.Web.Services.Description.OperationMessage -> bool
Public Function Contains (operationMessage As OperationMessage) As Boolean

Parametry

operationMessage
OperationMessage

Element OperationMessage , dla którego należy sprawdzić członkostwo w kolekcji.

Zwraca

Boolean

trueoperationMessage jeśli parametr jest elementem członkowskim OperationMessageCollection; w przeciwnym razie false.

Przykłady

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

Dotyczy