Table of Contents

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>
ObservableOppositeOrderedSet<TParent, TCollected>
Implements
IListExpression<TCollected>
ISetExpression<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 TParent

the 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 TCollected

The element to add to the set.

Returns

bool

true if the element is added to the set; false if the element is already in the set.

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 int

The zero-based index at which item should be inserted.

item TCollected

The 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 TCollected

The item to remove

index int

The 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 int

The arrayIndex on which the item is replaced

oldValue TCollected

The old value

newValue TCollected

The new value

SetOpposite(TCollected, TParent)

Sets the opposite value

protected abstract void SetOpposite(TCollected item, TParent newParent)

Parameters

item TCollected

The item to set the opposite

newParent TParent

The 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.