CodeCatchClauseCollection.Contains(CodeCatchClause) Metoda

Definice

Získá hodnotu, která označuje, zda kolekce obsahuje zadaný CodeCatchClause objekt.

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

Parametry

value
CodeCatchClause

Objekt CodeCatchClause , který se má v kolekci najít.

Návraty

truepokud kolekce obsahuje zadaný objekt; v opačném případě . false

Příklady

Následující příklad používá metodu Contains k vyhledání přítomnosti konkrétní CodeCatchClause instance a získá hodnotu indexu, ve které byla nalezena.

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

Platí pro

Viz také