一款简单易用的基础网络通讯组件库。

ConcurrentListT

线程安全的ListT,其基本操作和ListT一致。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
public class ConcurrentList<T> : IList<T>, 
	ICollection<T>, IEnumerable<T>, IEnumerable, IReadOnlyList<T>, IReadOnlyCollection<T>
Inheritance
Object    ConcurrentListT
Implements
ICollectionT, IEnumerableT, IListT, IReadOnlyCollectionT, IReadOnlyListT, IEnumerable

类型参数

T
元素类型

构造函数

ConcurrentListT 初始化ConcurrentListT类的新实例。
ConcurrentListT(IEnumerableT) 初始化ConcurrentListT类的新实例。
ConcurrentListT(Int32) 初始化ConcurrentListT类的新实例。

属性

Capacity 获取或设置容量。
CountGets the number of elements contained in the ICollectionT.
IsReadOnlyGets a value indicating whether the ICollectionT is read-only.
ItemGets or sets the element at the specified index.

方法

AddAdds an item to the ICollectionT.
AddRange 
BinarySearch(T) 
BinarySearch(T, IComparerT) 
BinarySearch(Int32, Int32, T, IComparerT) 
ClearRemoves all items from the ICollectionT.
ContainsDetermines whether the ICollectionT contains a specific value.
ConvertAllTOutput 
CopyToCopies the elements of the ICollectionT to an Array, starting at a particular Array index.
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
Find 
FindAll 
FindIndex(PredicateT) 
FindIndex(Int32, PredicateT) 
FindIndex(Int32, Int32, PredicateT) 
FindLast 
FindLastIndex(PredicateT) 
FindLastIndex(Int32, PredicateT) 
FindLastIndex(Int32, Int32, PredicateT) 
ForEach 
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetRange 
GetTypeGets the Type of the current instance.
(继承自 Object。)
IndexOf(T)Determines the index of a specific item in the IListT.
IndexOf(T, Int32) 
IndexOf(T, Int32, Int32) 
InsertInserts an item to the IListT at the specified index.
InsertRange 
LastIndexOf(T) 
LastIndexOf(T, Int32) 
LastIndexOf(T, Int32, Int32) 
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
RemoveRemoves the first occurrence of a specific object from the ICollectionT.
RemoveAll 
RemoveAtRemoves the IListT item at the specified index.
RemoveRange 
Reverse 
Reverse(Int32, Int32) 
Sort 
Sort(ComparisonT) 
Sort(IComparerT) 
Sort(Int32, Int32, IComparerT) 
ToArray 
ToStringReturns a string that represents the current object.
(继承自 Object。)
TrimExcess 
TrueForAll 

扩展方法

ForEachT 循环遍历每个元素,执行Action动作
(由 CollectionsExtension 定义。)
ForEachAsyncT 循环遍历每个元素,执行异步动作
(由 CollectionsExtension 定义。)
GetSafeEnumeratorT 获取安全的枚举器。
(由 SystemExtension 定义。)
Map 将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。)
Map 将源对象映射到目标类型的实例。
(由 Mapper 定义。)
MapTTarget 将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。)
MapListT, T1 扩展方法,将一个泛型集合中的每个元素映射到另一个泛型类型的新集合。
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

显式接口实现

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.

参见