IDictionaryEnumerator.Value 屬性

定義

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

public:
 property System::Object ^ Value { System::Object ^ 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在讀取的值Value之前, 必須呼叫以將枚舉器前移至集合的第一個元素。MoveNext must be called to advance the enumerator to the first element of the collection before reading the value of Value.

  • 最後一次呼叫MoveNextfalse傳回, 指出集合的結尾。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. MoveNextValue設定為列舉中下一個元素的值。MoveNext sets Value to the value of the next element in enumeration.

適用於

另請參閱