ParserErrorCollection.IndexOf(ParserError) Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient l'index de l'objet ParserError spécifié dans la collection.
public:
int IndexOf(System::Web::ParserError ^ value);
public int IndexOf (System.Web.ParserError value);
member this.IndexOf : System.Web.ParserError -> int
Public Function IndexOf (value As ParserError) As Integer
- value
- ParserError
ParserError à rechercher dans la collection.
Index de base zéro des objets ParserError de la collection ; sinon, si le ParserError n'est pas dans la collection.
L’exemple de code suivant montre comment localiser l’index d’un ParserError objet à l’index spécifié dans une ParserErrorCollection collection.
// Test for the presence of a ParserError in the
// collection, and retrieve its index if it is found.
ParserError testError = new ParserError("Error", "Path", 1);
int itemIndex = -1;
if (collection.Contains(testError))
itemIndex = collection.IndexOf(testError);
' Test for the presence of a ParserError in the
' collection, and retrieve its index if it is found.
Dim testError As New ParserError("Error", "Path", 1)
Dim itemIndex As Integer = -1
If collection.Contains(testError) Then
itemIndex = collection.IndexOf(testError)
End If
Utilisez la IndexOf méthode pour déterminer l’index d’un ParserError objet dans la collection. Cela est utile pour déterminer l’index de chacun ParserError lorsque vous itérer dans la collection à l’aide de l’objet IEnumerator retourné par la GetEnumerator méthode.
Produit | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |