OperationMessageCollection.Contains(OperationMessage) 方法

定义

确定指定 OperationMessage 是否为 OperationMessageCollection 的成员。

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

参数

operationMessage
OperationMessage

要为其检查集合成员资格的 OperationMessage

返回

Boolean

如果 operationMessage 参数是 OperationMessageCollection 的成员,则为 true;否则为 false

示例

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

适用于