CodeCatchClauseCollection.Contains(CodeCatchClause) Metódus

Definíció

Olyan értéket kap, amely jelzi, hogy a gyűjtemény tartalmazza-e a megadott CodeCatchClause objektumot.

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

Paraméterek

value
CodeCatchClause

A CodeCatchClause gyűjteményben keresendő objektum.

Válaszok

trueha a gyűjtemény tartalmazza a megadott objektumot; egyéb esetben. false

Példák

Az alábbi példa egy adott Contains példány jelenlétének keresésére használja a CodeCatchClause metódust, és lekéri a talált indexértéket.

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

A következőre érvényes:

Lásd még