Bagikan melalui


CodeCatchClauseCollection.Contains(CodeCatchClause) Metode

Definisi

Mendapatkan nilai yang menunjukkan apakah koleksi berisi objek yang ditentukan CodeCatchClause .

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

Objek CodeCatchClause yang akan ditemukan dalam koleksi.

Mengembalikan

true jika koleksi berisi objek yang ditentukan; jika tidak, false.

Contoh

Contoh berikut menggunakan Contains metode untuk mencari keberadaan instans tertentu CodeCatchClause dan mendapatkan nilai indeks tempatnya ditemukan.

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

Berlaku untuk

Lihat juga