[]
Base collection implementing IOwnedObject interface.
public class OwnedCollectionBase<TItem> : Collection<TItem>, IList<TItem>, ICollection<TItem>, IReadOnlyList<TItem>, IReadOnlyCollection<TItem>, IEnumerable<TItem>, IOwnedObject, IList, ICollection, IEnumerable
TItempublic OwnedCollectionBase()
Gets a value indicating whether the collection was changed.
public bool Changed { get; set; }
Gets a collection owner.
public object Owner { get; }
Adds all items from items to this collection.
public void AddRange(IEnumerable<TItem> items)
items IEnumerable<TItem>The collection containing items to add.
Adds all items from items to this collection.
public void AddRange(IEnumerable items)
items IEnumerableThe collection containing items to add.
protected override void ClearItems()
protected override void InsertItem(int index, TItem item)
index intitem TItemCalled when collection is changed, sets Changed to true.
protected virtual void OnChanged()
protected override void RemoveItem(int index)
index intprotected override void SetItem(int index, TItem item)
index intitem TItemSets the owner of the current object.
protected virtual void SetOwner(object value)
value objectThe owner to set.
Sorts the elements in the entire collection using the specified IComparer<T>.
public void Sort(IComparer<TItem> comparer)
comparer IComparer<TItem>Sorts the elements in the entire collection using the specified Comparison<T>.
public void Sort(Comparison<TItem> comparison)
comparison Comparison<TItem>Sorts the elements in a range of elements using the specified IComparer<T>.
public void Sort(int index, int count, IComparer<TItem> comparer)