CodeCatchClauseCollection.Contains(CodeCatchClause) Methode

Definition

Ruft einen Wert ab, der angibt, ob die Auflistung das angegebene CodeCatchClause-Objekt enthält.

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

Parameter

value
CodeCatchClause

Das CodeCatchClause-Objekt, das in der Auflistung gesucht werden soll.

Gibt zurück

true, wenn die Auflistung das angegebene Objekt enthält, andernfalls false.

Beispiele

Im folgenden Beispiel wird die Contains -Methode verwendet, um nach dem Vorhandensein einer bestimmten CodeCatchClause instance zu suchen, und ruft den Indexwert ab, an dem er gefunden wurde.

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

Gilt für:

Weitere Informationen