ConcurrentList<T>

public class ConcurrentList<T> : IEnumerable<T>
Provides very basic concurrent storage. This class is not high-performance.
T

Properties

Count

#
public int Count { get; }
Gets the number of items currently stored.

Methods

Add

#
public void Add(T item)
Add an item to this collection.
item (T)Item to add.

Apply<TOut>

#
public TOut Apply<TOut>(Func<List<T>, TOut> function)
Apply a delegate to the internal list. I hope you know how to write threadsafe code before you use this method.
function (Func<List<T>, TOut>)Function to apply.

Apply

#
public void Apply(Action<List<T>> action)
Apply a delegate to the internal list. I hope you know how to write threadsafe code before you use this method.
action (Action<List<T>>)Action to apply.

Contains

#
public bool Contains(T item)
Gets whether this list contains the given item.
item (T)Item to search for.
True if the item exists within the list, false if otherwise.

GetEnumerator

#
public IEnumerator<T> GetEnumerator()
Enumerate over all items in the concurrent list. This enumerator operates on a copy of the internal data and thus will not reflect changes made to the collection, but also won't throw a synchronisation exception. The enumerator itself does not run from a locked section.

Remove

#
public bool Remove(T item)
Remove an item from this collection.
item (T)Item to remove.
True if item was found and removed, false if otherwise.
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()