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
TParent
The type of the parent element
TCollected
The 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
parent
TParentthe 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
item
TCollectedThe 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
index
intThe zero-based index at which
item
should be inserted.item
TCollectedThe object to insert into the IList<T>.
Exceptions
- ArgumentOutOfRangeException
index
is 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
item
TCollectedThe item to remove
index
intThe 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
index
intThe arrayIndex on which the item is replaced
oldValue
TCollectedThe old value
newValue
TCollectedThe new value
SetOpposite(TCollected, TParent)
Sets the opposite value
protected abstract void SetOpposite(TCollected item, TParent newParent)
Parameters
item
TCollectedThe item to set the opposite
newParent
TParentThe 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.