SimpleSynchronizedCollection<T> Class
Provides a thread-safe generic collection that provides notifications when items are added or removed.
public class SimpleSynchronizedCollection<T> : SimpleObservableCollection<T> where T : class
- Type Parameters:
-
T
-The type of collection item.
- Inheritance:
- object Collection<T> SimpleObservableCollection<T> object
Constructors
SimpleSynchronizedCollection()
Initializes an instance of the class.
public SimpleSynchronizedCollection()
Methods
ClearItems()
Removes all items from the collection.
protected override void ClearItems()
InsertItem(int, T)
Inserts an item into the collection at the specified index.
protected override void InsertItem(int index, T item)
Parameter | Type | Description |
---|---|---|
index | int | The index at which to insert the item. |
item | T | The item to insert. |
RemoveItem(int)
Removes the item at the specified index.
protected override void RemoveItem(int index)
Parameter | Type | Description |
---|---|---|
index | int | The index of the item to remove. |
SetItem(int, T)
Replaces the item at the specified index.
protected override void SetItem(int index, T item)
Parameter | Type | Description |
---|---|---|
index | int | The index of the item to replace. |
item | T | The item with which to replace. |
TryFindItem(Func<T, bool>, out T)
Tries to find an item in the collection that matches the given predicate
.
protected virtual bool TryFindItem(Func<T, bool> predicate, out T matchedItem)
Parameter | Type | Description |
---|---|---|
predicate | Func<T, bool> | The predicate which defines the item to be found. |
matchedItem | T | When successful, outputs the matched item; otherwise, the default value for the collection type (e.g. |
Returns
- bool:
true
if an item was matched and output throughmatchedItem
; otherwise,false
.
Inherited Members
- SimpleObservableCollection<T>.BlockReentrancy()
- SimpleObservableCollection<T>.CheckReadOnly()
- SimpleObservableCollection<T>.CheckReentrancy()
- SimpleObservableCollection<T>.OnItemAdded(int, T)
- SimpleObservableCollection<T>.OnItemAdding(int, T)
- SimpleObservableCollection<T>.OnItemRemoved(int, T)
- SimpleObservableCollection<T>.OnItemRemoving(int, T)
- SimpleObservableCollection<T>.IsReadOnly
- SimpleObservableCollection<T>.ItemAdding
- SimpleObservableCollection<T>.ItemAdded
- SimpleObservableCollection<T>.ItemRemoving
- SimpleObservableCollection<T>.ItemRemoved
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()