ConcurrentDictionary<TKey,TValue>.GetEnumerator 方法

定義

傳回在 ConcurrentDictionary<TKey,TValue> 中逐一查看的列舉值。

public:
 virtual System::Collections::Generic::IEnumerator<System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ GetEnumerator();
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey,TValue>> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<'Key, 'Value>>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<'Key, 'Value>>
Public Function GetEnumerator () As IEnumerator(Of KeyValuePair(Of TKey, TValue))
Public Iterator Overridable NotOverridable Function GetEnumerator () As IEnumerator(Of KeyValuePair(Of TKey, TValue))

傳回

IEnumerator<KeyValuePair<TKey,TValue>>

ConcurrentDictionary<TKey,TValue> 的列舉程式。

實作

備註

從字典傳回的列舉值可以安全地與字典的讀取和寫入搭配使用,不過它並不代表字典的即時快照集。 透過列舉值公開的內容可能包含在呼叫 之後 GetEnumerator 對字典所做的修改。

適用於

另請參閱