共用方式為


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,要為其檢查集合成員資格。

傳回

如果 operationOperationCollection 的成員,則為 true,否則為 false

範例

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

if ( myOperationCollection->Contains( myOperation ) == true )
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if(myOperationCollection.Contains(myOperation) == true)
{
   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

適用於