Share via


CodeCatchClauseCollection.Contains(CodeCatchClause) Método

Definição

Obtém um valor que indica se a coleção contém o objeto CodeCatchClause especificado.

public:
 bool Contains(System::CodeDom::CodeCatchClause ^ value);
public bool Contains (System.CodeDom.CodeCatchClause value);
member this.Contains : System.CodeDom.CodeCatchClause -> bool
Public Function Contains (value As CodeCatchClause) As Boolean

Parâmetros

value
CodeCatchClause

O objeto CodeCatchClause a ser localizado na coleção.

Retornos

true se a coleção contiver o objeto especificado; caso contrário, false.

Exemplos

O exemplo a seguir usa o Contains método para pesquisar a presença de uma instância específica CodeCatchClause e obtém o valor de índice no qual foi encontrado.

// Tests for the presence of a CodeCatchClause in the 
// collection, and retrieves its index if it is found.
CodeCatchClause^ testClause = gcnew CodeCatchClause( "e" );
int itemIndex = -1;
if ( collection->Contains( testClause ) )
   itemIndex = collection->IndexOf( testClause );
// Tests for the presence of a CodeCatchClause in the
// collection, and retrieves its index if it is found.
CodeCatchClause testClause = new CodeCatchClause("e");
int itemIndex = -1;
if( collection.Contains( testClause ) )
    itemIndex = collection.IndexOf( testClause );
' Tests for the presence of a CodeCatchClause in the 
' collection, and retrieves its index if it is found.
Dim testClause As New CodeCatchClause("e")
Dim itemIndex As Integer = -1
If collection.Contains(testClause) Then
    itemIndex = collection.IndexOf(testClause)
End If

Aplica-se a

Confira também