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입니다.

반환

Int32

컬렉션에 포함된 ParserError 개체의 인덱스(0부터 시작) 또는 1(ParserError가 컬렉션에 없는 경우)입니다.

예제

다음 코드 예제에서는의 인덱스를 찾는 방법을 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 메서드.

적용 대상