ConcurrentStack<T>.Count 属性

定义

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

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

属性值

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

实现

注解

若要确定集合是否包含任何项,建议使用 IsEmpty 属性,而不是检索 Count 属性中的项数并将其与0进行比较。For determining whether the collection contains any items, use of the IsEmpty property is recommended rather than retrieving the number of items from the Count property and comparing it to 0.

适用于