ConcurrentDictionary<TKey,TValue>.Count Property

Definition

获取包含在 ConcurrentDictionary<TKey,TValue> 中的键/值对的数目。Gets the number of key/value pairs contained in the ConcurrentDictionary<TKey,TValue>.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Property Value

Int32

包含在 ConcurrentDictionary<TKey,TValue> 中的键/值对的数目。The number of key/value pairs contained in the ConcurrentDictionary<TKey,TValue>.

Implements

Exceptions

字典包含过多元素。The dictionary contains too many elements.

Remarks

此属性具有快照语义,并表示访问属性时 System.Collections.Concurrent.ConcurrentDictionary<TKey,TValue> 中的项数。This property has snapshot semantics and represents the number of items in the System.Collections.Concurrent.ConcurrentDictionary<TKey,TValue> at the moment when the property was accessed.

Applies to

See also