ConcurrentBag<T>.Count 属性

定义

获取 ConcurrentBag<T> 中包含的元素数。Gets the number of elements contained in the ConcurrentBag<T>.

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

属性值

ConcurrentBag<T> 中包含的元素数。The number of elements contained in the ConcurrentBag<T>.

实现

注解

返回的计数表示袋内容的时间快照。The count returned represents a moment-in-time snapshot of the contents of the bag. 在访问 Count 属性后,其他线程可能会立即添加或移除项。It is possible that other threads might add or remove items immediately after you access the Count property.

适用于

另请参阅