语言

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

适用于