語言

OperationCollection.Contains(Operation) 方法

定義

回傳一個值,表示指定 Operation 是否屬於 OperationCollection。

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

參數

operation
Operation

Operation查詢收藏會員資格。

傳回

true 若 operation 是 的成員 OperationCollection;否則, false。

範例

下列範例示範 Contains 方法的用法。

if ( myOperationCollection->Contains( myOperation ))
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if (myOperationCollection.Contains(myOperation))
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

適用於