ArraySegment<T>.Enumerator.Current 属性

定义

获取对枚举器当前位置的项目的引用。Gets a reference to the item at the current position of the enumerator.

public:
 property T Current { T get(); };
public T Current { get; }
member this.Current : 'T
Public ReadOnly Property Current As T

属性值

T

ArraySegment<T>位于枚举数当前位置的的元素。The element of the ArraySegment<T> at the current position of the enumerator.

实现

注解

Current 在下列任一情况下均未定义:Current is undefined under either of the following conditions:

  • 在创建枚举器后,枚举器将被定位到数组段中的第一个元素之前。Immediately after the enumerator is created, the enumerator is positioned before the first element in the array segment. MoveNext 在读取的值之前,必须调用以将枚举数前移到数组段的第一个元素 CurrentMoveNext must be called to advance the enumerator to the first element of the array segment before reading the value of Current.

  • 对返回的最后一个调用 MoveNext false ,指示数组段的末尾。The last call to MoveNext returned false, which indicates the end of the array segment.

Current 在调用之前,返回相同的值 MoveNextCurrent returns the same value until MoveNext is called. MoveNext 设置 Current 为数组段中的下一项。MoveNext sets Current to the next item in the array segment.

适用于