CodeCatchClauseCollection.IndexOf(CodeCatchClause) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém o índice do objeto especificado CodeCatchClause na coleção, se este existir na coleção.
public:
int IndexOf(System::CodeDom::CodeCatchClause ^ value);
public int IndexOf(System.CodeDom.CodeCatchClause value);
member this.IndexOf : System.CodeDom.CodeCatchClause -> int
Public Function IndexOf (value As CodeCatchClause) As Integer
Parâmetros
- value
- CodeCatchClause
O CodeCatchClause objeto a localizar na coleção.
Devoluções
O índice do objeto especificado, se encontrado, na coleção; caso contrário, -1.
Exemplos
O exemplo seguinte procura a presença de um objeto específico CodeCatchClause e utiliza o IndexOf método para obter o valor do índice em que foi encontrado.
// 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