CodeCatchClauseCollection.Contains(CodeCatchClause) Метод

Определение

Получает значение, которое указывает, содержит ли коллекция заданный объект 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

Параметры

value
CodeCatchClause

Объект CodeCatchClause, который требуется найти в коллекции.

Возвращаемое значение

Значение true, если коллекция содержит указанный объект; в обратном случае — значение false.

Примеры

В следующем примере метод используется Contains для поиска наличия определенного CodeCatchClause экземпляра и возвращает значение индекса, по которому он был найден.

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

Применяется к

См. также раздел