Collection<T>.IList.Item[Int32] Свойство
Определение
Возвращает или задает элемент по указанному индексу.Gets or sets the element at the specified index.
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; }
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
Отсчитываемый от нуля индекс элемента, который требуется возвратить или задать.The zero-based index of the element to get or set.
Значение свойства
Элемент, расположенный по указанному индексу.The element at the specified index.
Реализации
Исключения
Свойство задано, и тип параметра value
не может быть назначен IList.The property is set and value
is of a type that is not assignable to the IList.
Комментарии
Это свойство предоставляет доступ к указанному элементу коллекции при использовании следующего синтаксиса: myCollection[index]
.This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[index]
.
Язык C# использует ключевое слово this для определения индексаторов вместо реализации IList.Item[] Свойства.The C# language uses the this keyword to define the indexers instead of implementing the IList.Item[] property. В языке Visual Basic в качестве свойства по умолчанию реализовано свойство IList.Item[], предоставляющее те же возможности индексирования.Visual Basic implements IList.Item[] as a default property, which provides the same indexing functionality.
Получение значения этого свойства является операцией O (1); Задание свойства также является операцией O (1).Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation.