Table of Contents

Class ObservableEnumerable<T>

Namespace
NMF.Expressions.Linq
Assembly
NMF.Expressions.Linq.dll

Denotes an abstract base class for collection-valued DDG nodes

public abstract class ObservableEnumerable<T> : INotifyEnumerable<T>, INotifyEnumerable, INotifiable, ICollection<T>, IEnumerable<T>, INotifyCollectionChanged, IDisposable, ISuccessorList, IList, ICollection, IEnumerable

Type Parameters

T

The type of elements

Inheritance
ObservableEnumerable<T>
Implements
Derived
Inherited Members
Extension Methods

Properties

AllSuccessors

public IEnumerable<INotifiable> AllSuccessors { get; }

Property Value

IEnumerable<INotifiable>

Count

Gets the number of elements contained in the ICollection<T>.

public virtual int Count { get; }

Property Value

int

The number of elements contained in the ICollection<T>.

Dependencies

Nodes that notify this node.

public abstract IEnumerable<INotifiable> Dependencies { get; }

Property Value

IEnumerable<INotifiable>

ExecutionMetaData

Used by the execution engine during incremental execution.

public ExecutionMetaData ExecutionMetaData { get; }

Property Value

ExecutionMetaData

HasEventSubscriber

Indicates whether the collection has event subscribers attached

protected bool HasEventSubscriber { get; }

Property Value

bool

HasSuccessors

True, if there is any successor, otherwise False

public bool HasSuccessors { get; }

Property Value

bool

IsAttached

True, if successors are attached, otherwise False

public bool IsAttached { get; }

Property Value

bool

IsFixedSize

public virtual bool IsFixedSize { get; }

Property Value

bool

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

public virtual bool IsReadOnly { get; }

Property Value

bool

true if the ICollection<T> is read-only; otherwise, false.

IsSynchronized

public bool IsSynchronized { get; }

Property Value

bool

this[int]

public virtual object this[int index] { get; set; }

Parameters

index int

Property Value

object

Successors

The nodes that will get notified by this node.

public ISuccessorList Successors { get; }

Property Value

ISuccessorList

SyncRoot

public object SyncRoot { get; }

Property Value

object

Methods

Add(T)

Adds an item to the ICollection<T>.

public virtual void Add(T item)

Parameters

item T

The object to add to the ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Clear()

Removes all items from the ICollection<T>.

public virtual void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(T)

Determines whether the ICollection<T> contains a specific value.

public virtual bool Contains(T item)

Parameters

item T

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(T[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public abstract IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

GetSuccessor(int)

Gets the successor at the given index

public INotifiable GetSuccessor(int index)

Parameters

index int

The index

Returns

INotifiable

The DDG node with the given index

Notify(IList<INotificationResult>)

Gets called when one of the dependencies signals a notification.

public abstract INotificationResult Notify(IList<INotificationResult> sources)

Parameters

sources IList<INotificationResult>

Contains information about what triggered this notification.

Returns

INotificationResult

An object describing the changes that happened in this notification.

OnAddItem(T, int)

Raises the collection changed event for an added item

protected void OnAddItem(T item, int index = -1)

Parameters

item T

The item that is added

index int

The index at which the item is added or -1

OnAddItems(IEnumerable<T>, int)

Raises the collection changed event for added items

protected void OnAddItems(IEnumerable<T> items, int index = -1)

Parameters

items IEnumerable<T>

The items that are added

index int

The start index at which items are added

OnAttach()

Gets called when a successor attaches and there was no successor before

protected virtual void OnAttach()

OnCleared()

Raises the event that the collection was cleared

protected void OnCleared()

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Raises a collection changed event

protected void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

Parameters

e NotifyCollectionChangedEventArgs

the event data

OnDetach()

Gets called when the last successor detaches

protected virtual void OnDetach()

OnMoveItem(T, int, int)

Raises the event that the item was moved

protected void OnMoveItem(T item, int oldIndex = 0, int newIndex = 0)

Parameters

item T

the moved item

oldIndex int

the old index

newIndex int

the new index

OnMoveItems(IEnumerable<T>, int, int)

Raises the event that the items were moved

protected void OnMoveItems(IEnumerable<T> items, int oldIndex = 0, int newIndex = 0)

Parameters

items IEnumerable<T>

the moved items

oldIndex int

the old index

newIndex int

the new index

OnRemoveItem(T, int)

Raises the event that an item was removed

protected void OnRemoveItem(T item, int index = -1)

Parameters

item T

The item that was removed

index int

The index at which the item was removed or -1

OnRemoveItems(IEnumerable<T>, int)

Raises the event that items were removed

protected void OnRemoveItems(IEnumerable<T> items, int index = -1)

Parameters

items IEnumerable<T>

The items that have been removed

index int

The index at which items have been removed

OnReplaceItem(T, T, int)

Raises the event that the item was replaced

protected void OnReplaceItem(T old, T item, int index = -1)

Parameters

old T

the old item

item T

the new item

index int

the index of the elemnt or -1

OnReplaceItems(IEnumerable<T>, IEnumerable<T>, int)

Raises the event that items were replaced

protected void OnReplaceItems(IEnumerable<T> oldItems, IEnumerable<T> newItems, int index = -1)

Parameters

oldItems IEnumerable<T>

the old items

newItems IEnumerable<T>

the new items

index int

the index at which the items have been replaced

RaiseEvents(IList<T>, IList<T>, IList<T>, int, int)

Raises the events for the collections of changes

protected void RaiseEvents(IList<T> added, IList<T> removed, IList<T> moved, int oldItemsStartIndex = -1, int newItemsStartIndex = -1)

Parameters

added IList<T>

A list of the added items

removed IList<T>

A list of the removed items

moved IList<T>

A list of the moved items

oldItemsStartIndex int

the start index of old items or -1

newItemsStartIndex int

the start index of new items or -1

Remove(T)

Removes the first occurrence of a specific object from the ICollection<T>.

public virtual bool Remove(T item)

Parameters

item T

The object to remove from the ICollection<T>.

Returns

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Set(INotifiable)

Add the given DDG node to the list

public void Set(INotifiable node)

Parameters

node INotifiable

The DDG node to add

SetDummy()

Sets a dummy

public void SetDummy()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Unset(INotifiable, bool)

Unset the given DDG node as successor

public void Unset(INotifiable node, bool leaveDummy = false)

Parameters

node INotifiable

the DDG node

leaveDummy bool

True, to leave the dummy in operation, otherwise False

UnsetAll()

Clear the list

public void UnsetAll()

Events

CollectionChanged

Occurs when the collection changes.

public event NotifyCollectionChangedEventHandler CollectionChanged

Event Type

NotifyCollectionChangedEventHandler