SortedDictionary<TKey,TValue>.Enumerator.IDictionaryEnumerator.Value 屬性

定義

取得位於列舉值目前位置之項目的值。

property System::Object ^ System::Collections::IDictionaryEnumerator::Value { System::Object ^ get(); };
object System.Collections.IDictionaryEnumerator.Value { get; }
object? System.Collections.IDictionaryEnumerator.Value { get; }
member this.System.Collections.IDictionaryEnumerator.Value : obj
 ReadOnly Property Value As Object Implements IDictionaryEnumerator.Value

屬性值

位於集合中列舉值目前位置之項目的值。

實作

例外狀況

列舉值是放在集合的第一個項目之前,或最後一個項目之後。

備註

IDictionaryEnumerator.Value 在下列任一情況下未定義:

  • 列舉值位於集合的第一個專案之前。 這會在建立列舉值或呼叫 方法之後 IEnumerator.Reset 發生。 MoveNext必須先呼叫 方法,才能將列舉值前移至集合的第一個專案,然後再讀取 屬性的值IDictionaryEnumerator.Value

  • 最後一 MoveNext 次呼叫傳 false回 ,表示集合的結尾,而且列舉值位於集合的最後一個項目之後。

  • 列舉值因為集合中所做的變更而失效,例如新增、修改或刪除專案。

IDictionaryEnumerator.Value 不會移動列舉值的位置,而且連續呼叫會 IDictionaryEnumerator.Value 傳回相同的物件,直到 MoveNext 呼叫 或 IEnumerator.Reset 為止。

適用於

另請參閱