An enumerator object’s Current property is affected by yield return statements in the iterator block.
When an enumerator object is in the suspended state, the value of Current is the value set by the previous call to MoveNext. When an enumerator object is in the before, running, or after states, the result of accessing Current is unspecified.
For an iterator with a yield type other than object, the result of accessing Current through the enumerator object’s IEnumerable implementation corresponds to accessing Current through the enumerator object’s IEnumerator implementation and casting the result to object.
Do'stlaringiz bilan baham: |