CodeCatchClauseCollection.Contains(CodeCatchClause) Método

Definición

Obtiene un valor que indica si la colección contiene el 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

Objeto CodeCatchClause que se va a buscar en la colección.

Devoluciones

true si la colección contiene el objeto especificado; en caso contrario, false.

Ejemplos

En el ejemplo siguiente se usa el Contains método para buscar la presencia de una instancia específica CodeCatchClause y se obtiene el valor de índice en el que se encontró.

// 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

Se aplica a

Consulte también