IDictionaryEnumerator.Value 屬性


取得目前字典項目的值。Gets the value of the current dictionary entry.

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



列舉型別目前元素的值。The value of the current element of the enumeration.


IDictionaryEnumerator 位於字典的第一個元素之前,或最後一個元素之後。The IDictionaryEnumerator is positioned before the first entry of the dictionary or after the last entry.


Value 在下列任何情況下都未定義:Value is undefined under any of the following conditions:

  • 列舉值位於集合中的第一個元素之前,緊接在建立列舉值之後。The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. MoveNext 必須先呼叫,才能將列舉值前移至集合的第一個元素,然後再讀取的值 ValueMoveNext must be called to advance the enumerator to the first element of the collection before reading the value of Value.

  • 最後一個傳回的 MoveNext 呼叫 false ,表示集合結尾。The last call to MoveNext returned false, which indicates the end of the collection.

  • 列舉值因為集合中的變更(例如加入、修改或刪除元素)而失效。The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements.

Value 會傳回相同的物件直到呼叫 MoveNextValue returns the same object until MoveNext is called. MoveNext 設定 Value 為列舉中下一個元素的值。MoveNext sets Value to the value of the next element in enumeration.