CodeCatchClauseCollection.IndexOf(CodeCatchClause) Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Lekéri a gyűjteményben megadott CodeCatchClause objektum indexét, ha az a gyűjteményben található.
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
Paraméterek
- value
- CodeCatchClause
A CodeCatchClause gyűjteményben keresendő objektum.
Válaszok
A megadott objektum indexe, ha található, a gyűjteményben; ellenkező esetben -1.
Példák
Az alábbi példa egy adott CodeCatchClause objektum jelenlétét keresi, és a IndexOf metódussal lekéri azt az indexértéket, amelynél az objektum található.
// 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