Class ObservableOppositeOrderedSet<TParent, TCollected>
- Namespace
- NMF.Collections.ObjectModel
- Assembly
- NMF.Collections.dll
Denotes an abstract base class for an observable ordered set with opposites
public abstract class ObservableOppositeOrderedSet<TParent, TCollected> : ObservableOrderedSet<TCollected>, INotifyCollectionChanged, INotifyCollectionChanging, INotifyPropertyChanged, IOrderedSetExpression<TCollected>, IListExpression<TCollected>, ISetExpression<TCollected>, ICollectionExpression<TCollected>, IEnumerableExpression<TCollected>, IOrderedSet<TCollected>, IList<TCollected>, ISet<TCollected>, ICollection<TCollected>, IEnumerable<TCollected>, ICollectionExpression, IEnumerableExpression, IList, ICollection, IEnumerable
Type Parameters
TParentThe type of the parent element
TCollectedThe type of the collected elements
- Inheritance
-
DecoratedSet<TCollected>OrderedSet<TCollected>ObservableOrderedSet<TCollected>ObservableOppositeOrderedSet<TParent, TCollected>
- Implements
-
IOrderedSetExpression<TCollected>IListExpression<TCollected>ISetExpression<TCollected>ICollectionExpression<TCollected>IEnumerableExpression<TCollected>IOrderedSet<TCollected>IList<TCollected>ISet<TCollected>ICollection<TCollected>IEnumerable<TCollected>
- Inherited Members
- Extension Methods
Constructors
ObservableOppositeOrderedSet(TParent)
Creates a new instance
protected ObservableOppositeOrderedSet(TParent parent)
Parameters
parentTParentthe parent element
Exceptions
- ArgumentNullException
Thrown if the parent element is null
Properties
Parent
Gets the parent element
public TParent Parent { get; }
Property Value
- TParent
Methods
Add(TCollected)
Adds an element to the current set and returns a value to indicate if the element was successfully added.
public override bool Add(TCollected item)
Parameters
itemTCollectedThe element to add to the set.
Returns
Clear()
Removes all items from the ICollection<T>.
public override void Clear()
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Insert(int, TCollected)
Inserts an item to the IList<T> at the specified index.
public override void Insert(int index, TCollected item)
Parameters
indexintThe zero-based index at which
itemshould be inserted.itemTCollectedThe object to insert into the IList<T>.
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
Remove(TCollected, int)
Removes the given item at the given arrayIndex
protected override bool Remove(TCollected item, int index)
Parameters
itemTCollectedThe item to remove
indexintThe arrayIndex of the item
Returns
- bool
True, if the removal was successful, otherwise false
Replace(int, TCollected, TCollected)
Replaces the item at the given arrayIndex
protected override void Replace(int index, TCollected oldValue, TCollected newValue)
Parameters
indexintThe arrayIndex on which the item is replaced
oldValueTCollectedThe old value
newValueTCollectedThe new value
SetOpposite(TCollected, TParent)
Sets the opposite value
protected abstract void SetOpposite(TCollected item, TParent newParent)
Parameters
itemTCollectedThe item to set the opposite
newParentTParentThe new parent or null, if the element was removed
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.