ReadOnlyCollection<T>.IList.Item[Int32] 속성

정의

지정된 인덱스에서 요소를 가져옵니다. NotSupportedException 지정된 인덱스에서 항목을 설정하려고 하면 A가 발생합니다.

property System::Object ^ System::Collections::IList::Item[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
object System.Collections.IList.Item[int index] { get; set; }
member this.System.Collections.IList.Item(int) : obj with get, set
 Property Item(index As Integer) As Object Implements IList.Item

매개 변수

index
Int32

가져올 요소의 인덱스(0부터 시작)입니다.

속성 값

지정된 인덱스 요소입니다.

구현

예외

index가 .에서 유효한 인덱스가 아닌 경우 IList

속성이 설정된 경우 항상 throw됩니다.

설명

이 속성은 다음 구문을 myCollection[index]사용하여 컬렉션의 특정 요소에 액세스하는 기능을 제공합니다.

C# 언어는 키워드를 사용하여 속성을 구현하는 대신 인덱서를 정의합니다 IList.Item[] . Visual Basic은 IList.Item[] 동일한 인덱싱 기능을 제공하는 기본 속성으로 구현합니다.

이 속성의 값을 검색하는 것은 O(1) 작업입니다.

이 멤버는 명시적 인터페이스 멤버 구현입니다. 인스턴스가 인터페이스로 ReadOnlyCollection<T> 캐스팅 IDisposable 되는 경우에만 사용할 수 있습니다.

적용 대상