CodeCatchClauseCollection.Contains(CodeCatchClause) Methode

Definitie

Hiermee wordt een waarde opgehaald die aangeeft of de verzameling het opgegeven CodeCatchClause object bevat.

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

Parameters

value
CodeCatchClause

Het CodeCatchClause object dat in de verzameling moet worden gevonden.

Retouren

true als de verzameling het opgegeven object bevat; anders, false.

Voorbeelden

In het volgende voorbeeld wordt de Contains methode gebruikt om te zoeken naar de aanwezigheid van een specifiek CodeCatchClause exemplaar en wordt de indexwaarde opgehaald waarmee deze is gevonden.

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

Van toepassing op

Zie ook