List<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.
注解
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.