Table of Contents

Class ObservableAggregate<TSource, TAccumulator, TResult>

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

Denotes an abstract class for an aggregator incrementalization

public abstract class ObservableAggregate<TSource, TAccumulator, TResult> : NotifyValue<TResult>, INotifyValue<TResult>, INotifiable, IDisposable, ISuccessorList, IValueChangedNotificationResult<TResult>, IValueChangedNotificationResult, INotificationResult

Type Parameters

TSource

The source type of elements

TAccumulator

The accumulator used

TResult

The result type

Inheritance
NotifyValue<TResult>
ObservableAggregate<TSource, TAccumulator, TResult>
Implements
INotifyValue<TResult>
Inherited Members
Extension Methods

Constructors

ObservableAggregate(INotifyEnumerable<TSource>, TAccumulator)

Creates a new instance

protected ObservableAggregate(INotifyEnumerable<TSource> source, TAccumulator accumulator)

Parameters

source INotifyEnumerable<TSource>

The incrementalized source collection

accumulator TAccumulator

The initial value for the accumulator

Exceptions

ArgumentNullException

Thrown if source is null

Properties

Accumulator

Gets the current accumulator

protected TAccumulator Accumulator { get; set; }

Property Value

TAccumulator

Dependencies

Nodes that notify this node.

public override IEnumerable<INotifiable> Dependencies { get; }

Property Value

IEnumerable<INotifiable>

Source

Gets the source collection

protected INotifyEnumerable<TSource> Source { get; }

Property Value

INotifyEnumerable<TSource>

Methods

AddItem(TSource)

Adds the given item

protected abstract void AddItem(TSource item)

Parameters

item TSource

the item

Attach()

protected override void Attach()

Detach()

protected override void Detach()

Notify(IList<INotificationResult>)

Gets called when one of the dependencies signals a notification.

public override 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.

RemoveItem(TSource)

Removes the given item

protected abstract void RemoveItem(TSource item)

Parameters

item TSource

the item

ResetAccumulator()

Resets the accumulator

protected abstract void ResetAccumulator()