ParserErrorCollection.IndexOf(ParserError) 메서드

정의

컬렉션에서 지정된 ParserError 개체의 인덱스입니다.

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 컬렉션에서 찾을 위치입니다.

반품

컬렉션 내 개체의 ParserError 인덱스(0부터 시작)이고, 컬렉션에 없는 경우 ParserError 1입니다.

예제

다음 코드 예제에서는 컬렉션의 지정된 인덱스에서 개체의 ParserError 인덱 ParserErrorCollection 스를 찾는 방법을 보여 줍니다.

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

설명

메서드를 IndexOf 사용하여 컬렉션 내의 개체 인 ParserError 덱스 확인 메서드에서 반환된 개체를 사용하여 ParserError 컬렉션을 반복할 때 각 IEnumerator 인덱스의 인덱스 확인에 GetEnumerator 유용합니다.

적용 대상