ParserErrorCollection 클래스

정의

구문 분석 중에 검색된 파서 오류 집합을 관리합니다. 이 클래스는 상속할 수 없습니다.

public ref class ParserErrorCollection sealed : System::Collections::CollectionBase
[System.Serializable]
public sealed class ParserErrorCollection : System.Collections.CollectionBase
[<System.Serializable>]
type ParserErrorCollection = class
    inherit CollectionBase
Public NotInheritable Class ParserErrorCollection
Inherits CollectionBase
상속
ParserErrorCollection
특성

예제

다음 코드 예제에서는 메서드를 사용하는 방법을 보여 줍니다 ParserErrorCollection .

// Create an empty ParserErrorCollection.
ParserErrorCollection collection = new ParserErrorCollection();

// Add a ParserError to the collection.
collection.Add(new ParserError("ErrorName", "Path", 1));

// Add an array of ParserError objects to the collection.
ParserError[] errors = 
    { new ParserError("Error 2", "Path", 1), 
    new ParserError("Error 3", "Path", 1) };
collection.AddRange(errors);

// Add a collection of ParserError objects to the collection.
ParserErrorCollection errorsCollection = new ParserErrorCollection();
errorsCollection.Add(new ParserError("Error", "Path", 1));
errorsCollection.Add(new ParserError("Error", "Path", 1));
collection.AddRange(errorsCollection);

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

// Copy the contents of the collection to a
// compatible array, starting at index 0 of the
// destination array. 
ParserError[] errorsToSort = new ParserError[5];
collection.CopyTo(errorsToSort, 0);

// Retrieve the count of the items in the collection.
int collectionCount = collection.Count;

// Insert a ParserError at index 0 of the collection.
ParserError error = new ParserError("Error", "Path", 1);
collection.Insert(0, error);

// Remove the specified ParserError from the collection.
collection.Remove(error);

// Remove the ParserError at index 0.
collection.RemoveAt(0);
' Create an empty ParserErrorCollection.
Dim collection As New ParserErrorCollection()

' Add a ParserError to the collection.
collection.Add(New ParserError("ErrorName", "Path", 1))

' Add an array of ParserError objects to the collection.
Dim errors As ParserError() = _
    {New ParserError("Error 2", "Path", 1), _
    New ParserError("Error 3", "Path", 1)}
collection.AddRange(errors)

' Ads a collection of ParserError objects to the collection.
Dim errorsCollection As New ParserErrorCollection()
errorsCollection.Add(New ParserError("Error", "Path", 1))
errorsCollection.Add(New ParserError("Error", "Path", 1))
collection.AddRange(errorsCollection)

' 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

' Copy the contents of the collection to a
' compatible array, starting at index 0 of the
' destination array. 
Dim errorsToSort(5) As ParserError
collection.CopyTo(errorsToSort, 0)

' Retrieve the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

' Insert a ParserError at index 0 of the collection.
Dim [error] As New ParserError("Error", "Path", 1)
collection.Insert(0, [error])

' Remove the specified ParserError from the collection.
collection.Remove([error])

' Remove the ParserError at index 0.
collection.RemoveAt(0)

설명

클래스는 ParserErrorCollection 개체 컬렉션을 ParserError 관리하는 데 사용할 수 있는 메서드와 속성을 제공합니다. 예를 들어 사용자 지정 BuildProvider 개체를 사용하여 구문 분석 중에 catch된 모든 구문 분석 예외를 보고하는 동안 구문 분석 시 컬렉션에 파서 오류 집합을 추가할 수 있습니다.

파서 오류를 추가하거나, 제거하거나, 컬렉션에서 찾으려면 다음을 사용합니다.

또한 클래스를 ParserErrorCollection 사용하여 다음을 수행할 수 있습니다.

  • 메서드를 사용하여 개체를 Remove 제거 ParserError 합니다.

  • 메서드를 사용하여 특정 ParserError 개체가 컬렉션에 있는지 확인합니다 Contains .

  • 메서드를 ParserError 사용하여 컬렉션에서 개체가 있는 위치를 찾습니다 IndexOf .

생성자

Name Description
ParserErrorCollection()

ParserErrorCollection 클래스의 새 인스턴스를 초기화합니다.

ParserErrorCollection(ParserError[])

ParserErrorCollection 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
Capacity

포함할 수 있는 CollectionBase 요소의 수를 가져오거나 설정합니다.

(다음에서 상속됨 CollectionBase)
Count

인스턴스에 포함된 CollectionBase 요소 수를 가져옵니다. 이 속성은 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
InnerList

인스턴스의 ArrayList 요소 CollectionBase 목록을 포함하는 항목을 가져옵니다.

(다음에서 상속됨 CollectionBase)
Item[Int32]

컬렉션 내의 ParserError 지정된 인덱스에서 개체를 가져오거나 설정합니다.

List

인스턴스의 IList 요소 CollectionBase 목록을 포함하는 항목을 가져옵니다.

(다음에서 상속됨 CollectionBase)

메서드

Name Description
Add(ParserError)

컬렉션에 값을 추가합니다.

AddRange(ParserError[])

컬렉션에 개체 배열 ParserError 을 추가합니다.

AddRange(ParserErrorCollection)

컬렉션에 기존 ParserErrorCollection 개체를 추가합니다.

Clear()

인스턴스에서 모든 개체를 CollectionBase 제거합니다. 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
Contains(ParserError)

개체가 컬렉션에 ParserError 있는지 여부를 확인합니다.

CopyTo(ParserError[], Int32)

컬렉션의 ParserError 개체를 대상 배열의 지정된 인덱스에서 시작하여 호환되는 1차원 배열에 복사합니다.

Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

인스턴스를 반복하는 열거자를 반환합니다 CollectionBase .

(다음에서 상속됨 CollectionBase)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
IndexOf(ParserError)

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

Insert(Int32, ParserError)

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

MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnClear()

인스턴스의 CollectionBase 내용을 지울 때 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnClearComplete()

인스턴스의 CollectionBase 내용을 지워서 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnInsert(Int32, Object)

인스턴스에 새 요소를 CollectionBase 삽입하기 전에 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnInsertComplete(Int32, Object)

인스턴스에 새 요소를 CollectionBase 삽입한 후 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnRemove(Int32, Object)

인스턴스에서 CollectionBase 요소를 제거할 때 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnRemoveComplete(Int32, Object)

인스턴스에서 CollectionBase 요소를 제거한 후 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnSet(Int32, Object, Object)

인스턴스에서 CollectionBase 값을 설정하기 전에 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnSetComplete(Int32, Object, Object)

인스턴스에서 CollectionBase 값을 설정한 후 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnValidate(Object)

값의 유효성을 검사할 때 추가 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
Remove(ParserError)

컬렉션에서 지정된 ParserError 개체를 제거합니다.

RemoveAt(Int32)

인스턴스의 지정된 인덱스에 있는 요소를 제거합니다 CollectionBase . 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
ICollection.CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 호환되는 1차원CollectionBase으로 전체를 Array 복사합니다.

(다음에서 상속됨 CollectionBase)
ICollection.IsSynchronized

CollectionBase 대한 액세스가 동기화되는지 여부를 나타내는 값을 가져옵니다(스레드로부터 안전).

(다음에서 상속됨 CollectionBase)
ICollection.SyncRoot

CollectionBase대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.Add(Object)

의 끝에 개체를 추가합니다 CollectionBase.

(다음에서 상속됨 CollectionBase)
IList.Contains(Object)

특정 요소가 포함되어 있는지 여부를 CollectionBase 확인합니다.

(다음에서 상속됨 CollectionBase)
IList.IndexOf(Object)

지정한 Object 인덱스(0부터 시작)를 검색하여 전체에서 첫 번째 항목의 인덱스(0부터 시작)를 반환합니다 CollectionBase.

(다음에서 상속됨 CollectionBase)
IList.Insert(Int32, Object)

지정된 인덱스에 요소를 CollectionBase 삽입합니다.

(다음에서 상속됨 CollectionBase)
IList.IsFixedSize

고정 크기가 있는지 여부를 CollectionBase 나타내는 값을 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.IsReadOnly

CollectionBase 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.Item[Int32]

지정된 인덱스에서 요소를 가져오거나 설정합니다.

(다음에서 상속됨 CollectionBase)
IList.Remove(Object)

에서 특정 개체의 첫 번째 항목을 제거합니다 CollectionBase.

(다음에서 상속됨 CollectionBase)

확장명 메서드

Name Description
AsParallel(IEnumerable)

쿼리의 병렬 처리를 사용하도록 설정합니다.

AsQueryable(IEnumerable)

IEnumerable IQueryable변환합니다.

Cast<TResult>(IEnumerable)

IEnumerable 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable 요소를 필터링합니다.

적용 대상

추가 정보