Table of Contents

Class ObservableOrderedSet<T>

Namespace
NMF.Collections.ObjectModel
Assembly
NMF.Collections.dll

Denotes an observable ordered set

public class ObservableOrderedSet<T> : OrderedSet<T>, INotifyCollectionChanged, INotifyCollectionChanging, INotifyPropertyChanged, IOrderedSetExpression<T>, IListExpression<T>, ISetExpression<T>, ICollectionExpression<T>, IEnumerableExpression<T>, IOrderedSet<T>, IList<T>, ISet<T>, ICollection<T>, IEnumerable<T>, ICollectionExpression, IEnumerableExpression, IList, ICollection, IEnumerable

Type Parameters

T
Inheritance
ObservableOrderedSet<T>
Implements
ISet<T>
Derived
Inherited Members
Extension Methods

Methods

Add(T)

Adds an element to the current set and returns a value to indicate if the element was successfully added.

public override bool Add(T item)

Parameters

item T

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.

AsNotifiable()

Gets notifications for this collection

public INotifyCollection<T> AsNotifiable()

Returns

INotifyCollection<T>

A collection that will notify clients as new elements change

Clear()

Removes all items from the ICollection<T>.

public override void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Insert(int, T)

Inserts an item to the IList<T> at the specified index.

public override void Insert(int index, T item)

Parameters

index int

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

item T

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.

OnCollectionChanged(NotifyCollectionChangedEventArgs)

protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

OnCollectionChanging(NotifyCollectionChangedEventArgs)

protected void OnCollectionChanging(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

OnPropertyChanged(string)

protected void OnPropertyChanged(string property)

Parameters

property string

Remove(T, int)

Removes the given item at the given arrayIndex

protected override bool Remove(T item, int index)

Parameters

item T

The item to remove

index int

The arrayIndex of the item

Returns

bool

True, if the removal was successful, otherwise false

Replace(int, T, T)

Replaces the item at the given arrayIndex

protected override void Replace(int index, T oldValue, T newValue)

Parameters

index int

The arrayIndex on which the item is replaced

oldValue T

The old value

newValue T

The new value

RequireEvents()

Determines whether events are subscribed

protected bool RequireEvents()

Returns

bool

True, if there is any subscriber to CollectionChanged, PropertyChanged or CollectionChanging

SilentAdd(T)

Adds the element without notifications

protected bool SilentAdd(T item)

Parameters

item T

the element to be added

Returns

bool

true, if the element was added, otherwise false

SilentClear()

Clears the collection contents without notifications

protected void SilentClear()

SilentInsert(int, T)

Inserts the element at the given index without notifications

protected void SilentInsert(int index, T item)

Parameters

index int

the index at which the element should be inserted

item T

the item to insert

SilentRemove(T, int)

Removes the element without notifications

protected bool SilentRemove(T item, int index)

Parameters

item T

the element to remove

index int

the index of the removed element

Returns

bool

true, if the removal was successful, otherwise false

SilentReplace(int, T, T)

Replaces the element without notifications

protected void SilentReplace(int index, T oldValue, T newValue)

Parameters

index int

the index of the element

oldValue T

the old value

newValue T

the new value

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Events

CollectionChanged

Occurs when the collection changes.

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler

CollectionChanging

Gets raised when an attempt is made to change a given collection

public event EventHandler<NotifyCollectionChangedEventArgs> CollectionChanging

Event Type

EventHandler<NotifyCollectionChangedEventArgs>

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler