OperationMessageCollection.Contains(OperationMessage) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷指定的 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,要為其檢查集合成員資格。
傳回
如果 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