Table of Contents

Class ObservableListEx

Namespace
DynamicData
Assembly
DynamicData.dll

Extensions for ObservableList.

public static class ObservableListEx
Inheritance
ObservableListEx

Methods

Adapt<T>(IObservable<IChangeSet<T>>, IChangeSetAdaptor<T>)

Injects a side effect into a change set observable.

public static IObservable<IChangeSet<T>> Adapt<T>(this IObservable<IChangeSet<T>> source, IChangeSetAdaptor<T> adaptor) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

adaptor IChangeSetAdaptor<T>

The adaptor.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or adaptor.

AddKey<TObject, TKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TKey>)

Adds a key to the change set result which enables all observable cache features of dynamic data.

public static IObservable<IChangeSet<TObject, TKey>> AddKey<TObject, TKey>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TKey> keySelector) where TObject : notnull where TKey : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

keySelector Func<TObject, TKey>

The key selector.

Returns

IObservable<IChangeSet<TObject, TKey>>

An observable which emits the change set.

Type Parameters

TObject

The type of object.

TKey

The type of key.

Remarks

All indexed changes are dropped i.e. sorting is not supported by this function.

And<T>(IObservableList<IObservableList<T>>)

Dynamically apply a logical And operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> And<T>(this IObservableList<IObservableList<T>> sources) where T : notnull

Parameters

sources IObservableList<IObservableList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

And<T>(IObservableList<ISourceList<T>>)

Dynamically apply a logical And operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> And<T>(this IObservableList<ISourceList<T>> sources) where T : notnull

Parameters

sources IObservableList<ISourceList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

And<T>(IObservableList<IObservable<IChangeSet<T>>>)

Dynamically apply a logical And operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> And<T>(this IObservableList<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources IObservableList<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

And<T>(ICollection<IObservable<IChangeSet<T>>>)

Apply a logical And operator between the collections. Items which are in all of the sources are included in the result.

public static IObservable<IChangeSet<T>> And<T>(this ICollection<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources ICollection<IObservable<IChangeSet<T>>>

The sources.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

And<T>(IObservable<IChangeSet<T>>, params IObservable<IChangeSet<T>>[])

Apply a logical And operator between the collections. Items which are in all of the sources are included in the result.

public static IObservable<IChangeSet<T>> And<T>(this IObservable<IChangeSet<T>> source, params IObservable<IChangeSet<T>>[] others) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

others IObservable<IChangeSet<T>>[]

The others.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

AsObservableList<T>(ISourceList<T>)

Converts the source list to an read only observable list.

public static IObservableList<T> AsObservableList<T>(this ISourceList<T> source) where T : notnull

Parameters

source ISourceList<T>

The source.

Returns

IObservableList<T>

An observable list.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

AsObservableList<T>(IObservable<IChangeSet<T>>)

Converts the source observable to an read only observable list.

public static IObservableList<T> AsObservableList<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservableList<T>

An observable list.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

AutoRefreshOnObservable<TObject, TAny>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<TAny>>, TimeSpan?, IScheduler?)

Automatically refresh downstream operator. The refresh is triggered when the observable receives a notification.

public static IObservable<IChangeSet<TObject>> AutoRefreshOnObservable<TObject, TAny>(this IObservable<IChangeSet<TObject>> source, Func<TObject, IObservable<TAny>> reevaluator, TimeSpan? changeSetBuffer = null, IScheduler? scheduler = null) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source observable change set.

reevaluator Func<TObject, IObservable<TAny>>

An observable which acts on items within the collection and produces a value when the item should be refreshed.

changeSetBuffer TimeSpan?

Batch up changes by specifying the buffer. This greatly increases performance when many elements require a refresh.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<TObject>>

An observable change set with additional refresh changes.

Type Parameters

TObject

The type of object.

TAny

A ignored type used for specifying what to auto refresh on.

AutoRefresh<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan?, TimeSpan?, IScheduler?)

Automatically refresh downstream operators when any property changes.

public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject>(this IObservable<IChangeSet<TObject>> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source observable.

changeSetBuffer TimeSpan?

Batch up changes by specifying the buffer. This greatly increases performance when many elements have successive property changes.

propertyChangeThrottle TimeSpan?

When observing on multiple property changes, apply a throttle to prevent excessive refresh invocations.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<TObject>>

An observable change set with additional refresh changes.

Type Parameters

TObject

The type of object.

AutoRefresh<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, TimeSpan?, TimeSpan?, IScheduler?)

Automatically refresh downstream operators when properties change.

public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject, TProperty>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TProperty>> propertyAccessor, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source observable.

propertyAccessor Expression<Func<TObject, TProperty>>

Specify a property to observe changes. When it changes a Refresh is invoked.

changeSetBuffer TimeSpan?

Batch up changes by specifying the buffer. This greatly increases performance when many elements have successive property changes.

propertyChangeThrottle TimeSpan?

When observing on multiple property changes, apply a throttle to prevent excessive refresh invocations.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<TObject>>

An observable change set with additional refresh changes.

Type Parameters

TObject

The type of object.

TProperty

The type of property.

Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, BindingOptions)

Binds a clone of the observable change set to the target observable collection.

public static IObservable<IChangeSet<T>> Bind<T>(this IObservable<IChangeSet<T>> source, IObservableCollection<T> targetCollection, BindingOptions options) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

targetCollection IObservableCollection<T>

The target collection.

options BindingOptions

The binding options.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or targetCollection.

Bind<T>(IObservable<IChangeSet<T>>, IObservableCollection<T>, int)

Binds a clone of the observable change set to the target observable collection.

public static IObservable<IChangeSet<T>> Bind<T>(this IObservable<IChangeSet<T>> source, IObservableCollection<T> targetCollection, int resetThreshold = 25) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

targetCollection IObservableCollection<T>

The target collection.

resetThreshold int

The reset threshold.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or targetCollection.

Bind<T>(IObservable<IChangeSet<T>>, out ReadOnlyObservableCollection<T>, BindingOptions)

Creates a binding to a readonly observable collection which is specified as an 'out' parameter.

public static IObservable<IChangeSet<T>> Bind<T>(this IObservable<IChangeSet<T>> source, out ReadOnlyObservableCollection<T> readOnlyObservableCollection, BindingOptions options) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

readOnlyObservableCollection ReadOnlyObservableCollection<T>

The resulting read only observable collection.

options BindingOptions

The binding options.

Returns

IObservable<IChangeSet<T>>

A continuation of the source stream.

Type Parameters

T

The type of the item.

Bind<T>(IObservable<IChangeSet<T>>, out ReadOnlyObservableCollection<T>, int)

Creates a binding to a readonly observable collection which is specified as an 'out' parameter.

public static IObservable<IChangeSet<T>> Bind<T>(this IObservable<IChangeSet<T>> source, out ReadOnlyObservableCollection<T> readOnlyObservableCollection, int resetThreshold = 25) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

readOnlyObservableCollection ReadOnlyObservableCollection<T>

The resulting read only observable collection.

resetThreshold int

The reset threshold.

Returns

IObservable<IChangeSet<T>>

A continuation of the source stream.

Type Parameters

T

The type of the item.

Bind<T>(IObservable<IChangeSet<T>>, BindingList<T>, int)

Binds a clone of the observable change set to the target observable collection.

public static IObservable<IChangeSet<T>> Bind<T>(this IObservable<IChangeSet<T>> source, BindingList<T> bindingList, int resetThreshold = 25) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

bindingList BindingList<T>

The target binding list.

resetThreshold int

The reset threshold.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or targetCollection.

BufferIf<T>(IObservable<IChangeSet<T>>, IObservable<bool>, bool, TimeSpan?, IScheduler?)

Batches the underlying updates if a pause signal (i.e when the buffer selector return true) has been received. When a resume signal has been received the batched updates will be fired.

public static IObservable<IChangeSet<T>> BufferIf<T>(this IObservable<IChangeSet<T>> source, IObservable<bool> pauseIfTrueSelector, bool initialPauseState, TimeSpan? timeOut, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

pauseIfTrueSelector IObservable<bool>

When true, observable begins to buffer and when false, window closes and buffered result if notified.

initialPauseState bool

if set to true [initial pause state].

timeOut TimeSpan?

Specify a time to ensure the buffer window does not stay open for too long.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

BufferIf<T>(IObservable<IChangeSet<T>>, IObservable<bool>, bool, IScheduler?)

Batches the underlying updates if a pause signal (i.e when the buffer selector return true) has been received. When a resume signal has been received the batched updates will be fired.

public static IObservable<IChangeSet<T>> BufferIf<T>(this IObservable<IChangeSet<T>> source, IObservable<bool> pauseIfTrueSelector, bool initialPauseState, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

pauseIfTrueSelector IObservable<bool>

When true, observable begins to buffer and when false, window closes and buffered result if notified.

initialPauseState bool

if set to true [initial pause state].

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

BufferIf<T>(IObservable<IChangeSet<T>>, IObservable<bool>, TimeSpan?, IScheduler?)

Batches the underlying updates if a pause signal (i.e when the buffer selector return true) has been received. When a resume signal has been received the batched updates will be fired.

public static IObservable<IChangeSet<T>> BufferIf<T>(this IObservable<IChangeSet<T>> source, IObservable<bool> pauseIfTrueSelector, TimeSpan? timeOut, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

pauseIfTrueSelector IObservable<bool>

When true, observable begins to buffer and when false, window closes and buffered result if notified.

timeOut TimeSpan?

Specify a time to ensure the buffer window does not stay open for too long.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

BufferIf<T>(IObservable<IChangeSet<T>>, IObservable<bool>, IScheduler?)

Batches the underlying updates if a pause signal (i.e when the buffer selector return true) has been received. When a resume signal has been received the batched updates will be fired.

public static IObservable<IChangeSet<T>> BufferIf<T>(this IObservable<IChangeSet<T>> source, IObservable<bool> pauseIfTrueSelector, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

pauseIfTrueSelector IObservable<bool>

When true, observable begins to buffer and when false, window closes and buffered result if notified.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

BufferInitial<TObject>(IObservable<IChangeSet<TObject>>, TimeSpan, IScheduler?)

Buffers changes for an initial period only. After the period has elapsed, not further buffering occurs.

public static IObservable<IChangeSet<TObject>> BufferInitial<TObject>(this IObservable<IChangeSet<TObject>> source, TimeSpan initialBuffer, IScheduler? scheduler = null) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source change set.

initialBuffer TimeSpan

The period to buffer, measure from the time that the first item arrives.

scheduler IScheduler

The scheduler to buffer on.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits the change set.

Type Parameters

TObject

The type of object.

CastToObject<T>(IObservable<IChangeSet<T>>)

Cast the underlying type of an object. Use before a Cast function.

public static IObservable<IChangeSet<object>> CastToObject<T>(this IObservable<IChangeSet<T>> source) where T : class

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<object>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Cast<TDestination>(IObservable<IChangeSet<object>>)

Cast the changes to another form.

public static IObservable<IChangeSet<TDestination>> Cast<TDestination>(this IObservable<IChangeSet<object>> source) where TDestination : notnull

Parameters

source IObservable<IChangeSet<object>>

The source.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TDestination

The type of the destination.

Cast<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>)

Cast the changes to another form.

Alas, I had to add the converter due to type inference issues. The converter can be avoided by CastToObject() first.

public static IObservable<IChangeSet<TDestination>> Cast<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, TDestination> conversionFactory) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

conversionFactory Func<TSource, TDestination>

The conversion factory.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TSource

The type of the object.

TDestination

The type of the destination.

Clone<T>(IObservable<IChangeSet<T>>, IList<T>)

Clones the target list as a side effect of the stream.

public static IObservable<IChangeSet<T>> Clone<T>(this IObservable<IChangeSet<T>> source, IList<T> target) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

target IList<T>

The target of the clone.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

Convert<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, TDestination>)

Convert the object using the specified conversion function.

This is a lighter equivalent of Transform and is designed to be used with non-disposable objects.

[Obsolete("Prefer Cast as it is does the same thing but is semantically correct")]
public static IObservable<IChangeSet<TDestination>> Convert<TObject, TDestination>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TDestination> conversionFactory) where TObject : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

conversionFactory Func<TObject, TDestination>

The conversion factory.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TDestination

The type of the destination.

DeferUntilLoaded<T>(IObservableList<T>)

Defer the subscription until the cache has been inflated with data.

public static IObservable<IChangeSet<T>> DeferUntilLoaded<T>(this IObservableList<T> source) where T : notnull

Parameters

source IObservableList<T>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

DeferUntilLoaded<T>(IObservable<IChangeSet<T>>)

Defer the subscription until the stream has been inflated with data.

public static IObservable<IChangeSet<T>> DeferUntilLoaded<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

DisposeMany<T>(IObservable<IChangeSet<T>>)

Disposes each item when no longer required.

Individual items are disposed after removal or replacement changes have been sent downstream. All items previously-published on the stream are disposed after the stream finalizes.

public static IObservable<IChangeSet<T>> DisposeMany<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

A continuation of the original stream.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

DistinctValues<TObject, TValue>(IObservable<IChangeSet<TObject>>, Func<TObject, TValue>)

Selects distinct values from the source, using the specified value selector.

public static IObservable<IChangeSet<TValue>> DistinctValues<TObject, TValue>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TValue> valueSelector) where TObject : notnull where TValue : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

valueSelector Func<TObject, TValue>

The transform factory.

Returns

IObservable<IChangeSet<TValue>>

An observable which emits the change set.

Type Parameters

TObject

The type of the source.

TValue

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

Except<T>(IObservableList<IObservableList<T>>)

Dynamically apply a logical Except operator. Items from the first observable list are included when an equivalent item does not exist in the other sources.

public static IObservable<IChangeSet<T>> Except<T>(this IObservableList<IObservableList<T>> sources) where T : notnull

Parameters

sources IObservableList<IObservableList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Except<T>(IObservableList<ISourceList<T>>)

Dynamically apply a logical Except operator. Items from the first observable list are included when an equivalent item does not exist in the other sources.

public static IObservable<IChangeSet<T>> Except<T>(this IObservableList<ISourceList<T>> sources) where T : notnull

Parameters

sources IObservableList<ISourceList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Except<T>(IObservableList<IObservable<IChangeSet<T>>>)

Dynamically apply a logical Except operator. Items from the first observable list are included when an equivalent item does not exist in the other sources.

public static IObservable<IChangeSet<T>> Except<T>(this IObservableList<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources IObservableList<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Except<T>(ICollection<IObservable<IChangeSet<T>>>)

Apply a logical Except operator between the collections. Items which are in the source and not in the others are included in the result.

public static IObservable<IChangeSet<T>> Except<T>(this ICollection<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources ICollection<IObservable<IChangeSet<T>>>

The sources.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Except<T>(IObservable<IChangeSet<T>>, params IObservable<IChangeSet<T>>[])

Apply a logical Except operator between the collections. Items which are in the source and not in the others are included in the result.

public static IObservable<IChangeSet<T>> Except<T>(this IObservable<IChangeSet<T>> source, params IObservable<IChangeSet<T>>[] others) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

others IObservable<IChangeSet<T>>[]

The others.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

ExpireAfter<T>(ISourceList<T>, Func<T, TimeSpan?>, TimeSpan?, IScheduler?)

Removes items from the cache according to the value specified by the time selector function.

public static IObservable<IEnumerable<T>> ExpireAfter<T>(this ISourceList<T> source, Func<T, TimeSpan?> timeSelector, TimeSpan? pollingInterval = null, IScheduler? scheduler = null) where T : notnull

Parameters

source ISourceList<T>

The source.

timeSelector Func<T, TimeSpan?>

Selector returning when to expire the item. Return null for non-expiring item.

pollingInterval TimeSpan?

Enter the polling interval to optimise expiry timers, if omitted 1 timer is created for each unique expiry time.

scheduler IScheduler

The scheduler.

Returns

IObservable<IEnumerable<T>>

An observable which emits the enumerable of items.

Type Parameters

T

The type of the item.

ExpireAfter<T>(ISourceList<T>, Func<T, TimeSpan?>, IScheduler?)

Removes items from the cache according to the value specified by the time selector function.

public static IObservable<IEnumerable<T>> ExpireAfter<T>(this ISourceList<T> source, Func<T, TimeSpan?> timeSelector, IScheduler? scheduler = null) where T : notnull

Parameters

source ISourceList<T>

The source.

timeSelector Func<T, TimeSpan?>

Selector returning when to expire the item. Return null for non-expiring item.

scheduler IScheduler

The scheduler.

Returns

IObservable<IEnumerable<T>>

An observable which emits the enumerable of items.

Type Parameters

T

The type of the item.

FilterOnObservable<TObject>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<bool>>, TimeSpan?, IScheduler?)

Filters source on the specified observable property using the specified predicate.

The filter will automatically reapply when a property changes.

public static IObservable<IChangeSet<TObject>> FilterOnObservable<TObject>(this IObservable<IChangeSet<TObject>> source, Func<TObject, IObservable<bool>> objectFilterObservable, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

objectFilterObservable Func<TObject, IObservable<bool>>

The filter property selector. When the observable changes the filter will be re-evaluated.

propertyChangedThrottle TimeSpan?

The property changed throttle.

scheduler IScheduler

The scheduler used when throttling.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

FilterOnProperty<TObject, TProperty>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TProperty>>, Func<TObject, bool>, TimeSpan?, IScheduler?)

Filters source on the specified property using the specified predicate.

The filter will automatically reapply when a property changes.

[Obsolete("Use AutoRefresh(), followed by Filter() instead")]
public static IObservable<IChangeSet<TObject>> FilterOnProperty<TObject, TProperty>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TProperty>> propertySelector, Func<TObject, bool> predicate, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertySelector Expression<Func<TObject, TProperty>>

The property selector. When the property changes the filter specified will be re-evaluated.

predicate Func<TObject, bool>

A predicate based on the object which contains the changed property.

propertyChangedThrottle TimeSpan?

The property changed throttle.

scheduler IScheduler

The scheduler used when throttling.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TProperty

The type of the property.

Filter<T>(IObservable<IChangeSet<T>>, Func<T, bool>)

Filters the source using the specified valueSelector.

public static IObservable<IChangeSet<T>> Filter<T>(this IObservable<IChangeSet<T>> source, Func<T, bool> predicate) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

predicate Func<T, bool>

The valueSelector.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

Filter<T>(IObservable<IChangeSet<T>>, IObservable<Func<T, bool>>, ListFilterPolicy)

Filters source using the specified filter observable predicate.

public static IObservable<IChangeSet<T>> Filter<T>(this IObservable<IChangeSet<T>> source, IObservable<Func<T, bool>> predicate, ListFilterPolicy filterPolicy = ListFilterPolicy.CalculateDiff) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

predicate IObservable<Func<T, bool>>

The predicate which indicates which items should be included.

filterPolicy ListFilterPolicy

Should the filter clear and replace, or calculate a diff-set.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or filterController.

FlattenBufferResult<T>(IObservable<IList<IChangeSet<T>>>)

Convert the result of a buffer operation to a change set.

public static IObservable<IChangeSet<T>> FlattenBufferResult<T>(this IObservable<IList<IChangeSet<T>>> source) where T : notnull

Parameters

source IObservable<IList<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

ForEachChange<TObject>(IObservable<IChangeSet<TObject>>, Action<Change<TObject>>)

Provides a call back for each item change.

public static IObservable<IChangeSet<TObject>> ForEachChange<TObject>(this IObservable<IChangeSet<TObject>> source, Action<Change<TObject>> action) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

action Action<Change<TObject>>

The action.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

ForEachItemChange<TObject>(IObservable<IChangeSet<TObject>>, Action<ItemChange<TObject>>)

Provides a call back for each item change.

Range changes are flattened, so there is only need to check for Add, Replace, Remove and Clear.

public static IObservable<IChangeSet<TObject>> ForEachItemChange<TObject>(this IObservable<IChangeSet<TObject>> source, Action<ItemChange<TObject>> action) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

action Action<ItemChange<TObject>>

The action.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

GroupOnPropertyWithImmutableState<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?)

Groups the source using the property specified by the property selector. The resulting groupings are immutable. Groups are re-applied when the property value changed. When there are likely to be a large number of group property changes specify a throttle to improve performance.

public static IObservable<IChangeSet<IGrouping<TObject, TGroup>>> GroupOnPropertyWithImmutableState<TObject, TGroup>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TGroup>> propertySelector, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertySelector Expression<Func<TObject, TGroup>>

The property selector used to group the items.

propertyChangedThrottle TimeSpan?

The property changed throttle.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<IGrouping<TObject, TGroup>>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TGroup

The type of the group.

GroupOnProperty<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TGroup>>, TimeSpan?, IScheduler?)

Groups the source using the property specified by the property selector. The resulting groupings contains an inner observable list. Groups are re-applied when the property value changed. When there are likely to be a large number of group property changes specify a throttle to improve performance.

public static IObservable<IChangeSet<IGroup<TObject, TGroup>>> GroupOnProperty<TObject, TGroup>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TGroup>> propertySelector, TimeSpan? propertyChangedThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged where TGroup : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertySelector Expression<Func<TObject, TGroup>>

The property selector used to group the items.

propertyChangedThrottle TimeSpan?

The property changed throttle.

scheduler IScheduler

The scheduler.

Returns

IObservable<IChangeSet<IGroup<TObject, TGroup>>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TGroup

The type of the group.

GroupOn<TObject, TGroup>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroup>, IObservable<Unit?>?)

Groups the source on the value returned by group selector factory. The groupings contains an inner observable list.

public static IObservable<IChangeSet<IGroup<TObject, TGroup>>> GroupOn<TObject, TGroup>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TGroup> groupSelector, IObservable<Unit?>? regrouper = null) where TObject : notnull where TGroup : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

groupSelector Func<TObject, TGroup>

The group selector.

regrouper IObservable<Unit>

Force the grouping function to recalculate the group value. For example if you have a time based grouping with values like `Last Minute', 'Last Hour', 'Today' etc regrouper is used to refresh these groupings.

Returns

IObservable<IChangeSet<IGroup<TObject, TGroup>>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TGroup

The type of the group.

Exceptions

ArgumentNullException

source or groupSelector.

GroupWithImmutableState<TObject, TGroupKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TGroupKey>, IObservable<Unit?>?)

Groups the source on the value returned by group selector factory. Each update produces immutable grouping.

public static IObservable<IChangeSet<IGrouping<TObject, TGroupKey>>> GroupWithImmutableState<TObject, TGroupKey>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TGroupKey> groupSelectorKey, IObservable<Unit?>? regrouper = null) where TObject : notnull where TGroupKey : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

groupSelectorKey Func<TObject, TGroupKey>

The group selector key.

regrouper IObservable<Unit>

Force the grouping function to recalculate the group value. For example if you have a time based grouping with values like `Last Minute', 'Last Hour', 'Today' etc regrouper is used to refresh these groupings.

Returns

IObservable<IChangeSet<IGrouping<TObject, TGroupKey>>>

An observable which emits the change set.

Type Parameters

TObject

The type of the object.

TGroupKey

The type of the group key.

Exceptions

ArgumentNullException

source or groupSelectorKey.

LimitSizeTo<T>(ISourceList<T>, int, IScheduler?)

Limits the size of the source cache to the specified limit. Notifies which items have been removed from the source list.

public static IObservable<IEnumerable<T>> LimitSizeTo<T>(this ISourceList<T> source, int sizeLimit, IScheduler? scheduler = null) where T : notnull

Parameters

source ISourceList<T>

The source.

sizeLimit int

The size limit.

scheduler IScheduler

The scheduler.

Returns

IObservable<IEnumerable<T>>

An observable which emits a enumerable of items.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

ArgumentException

sizeLimit cannot be zero.

MergeChangeSets<TObject>(IObservableList<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?)

Merges all of the Cache Observable ChangeSets into a single ChangeSets that correctly handles removal of the parent items.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IObservableList<IObservable<IChangeSet<TObject>>> source, IEqualityComparer<TObject>? equalityComparer = null) where TObject : notnull

Parameters

source IObservableList<IObservable<IChangeSet<TObject>>>

The SourceList of Observable Cache ChangeSets.

equalityComparer IEqualityComparer<TObject>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject>(IEnumerable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?, IScheduler?, bool)

Operator similiar to Merge except it is ChangeSet aware. All of the observable changesets are merged together into a single stream of ChangeSet events.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IEnumerable<IObservable<IChangeSet<TObject>>> source, IEqualityComparer<TObject>? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull

Parameters

source IEnumerable<IObservable<IChangeSet<TObject>>>

The Source Observable ChangeSet.

equalityComparer IEqualityComparer<TObject>

IEqualityComparer<T> instance to determine if two elements are the same.

scheduler IScheduler

(Optional) System.Reactive.Concurrency.IScheduler instance to use when enumerating the collection.

completable bool

Whether or not the result Observable should complete if all the changesets complete.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject>(IObservable<IChangeSet<IObservable<IChangeSet<TObject>>>>, IEqualityComparer<TObject>?)

Merges each Observable ChangeSet in the ObservableList into a single stream of ChangeSets that correctly handles removal of the parent items.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IObservable<IChangeSet<IObservable<IChangeSet<TObject>>>> source, IEqualityComparer<TObject>? equalityComparer = null) where TObject : notnull

Parameters

source IObservable<IChangeSet<IObservable<IChangeSet<TObject>>>>

The List Observable ChangeSet of Cache Observable ChangeSets.

equalityComparer IEqualityComparer<TObject>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject>(IObservable<IChangeSet<TObject>>, IEnumerable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?, IScheduler?, bool)

Operator similiar to Merge except it is ChangeSet aware. Merges the source changeset and the collection of other changesets together into a single stream of ChangeSet events.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IObservable<IChangeSet<TObject>> source, IEnumerable<IObservable<IChangeSet<TObject>>> others, IEqualityComparer<TObject>? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The Source Observable ChangeSet.

others IEnumerable<IObservable<IChangeSet<TObject>>>

The Other Observable ChangeSets.

equalityComparer IEqualityComparer<TObject>

IEqualityComparer<T> instance to determine if two elements are the same.

scheduler IScheduler

(Optional) System.Reactive.Concurrency.IScheduler instance to use when enumerating the collection.

completable bool

Whether or not the result Observable should complete if all the changesets complete.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject>(IObservable<IChangeSet<TObject>>, IObservable<IChangeSet<TObject>>, IEqualityComparer<TObject>?, IScheduler?, bool)

Operator similiar to Merge except it is ChangeSet aware. Merges both observable changesets into a single stream of ChangeSet events.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IObservable<IChangeSet<TObject>> source, IObservable<IChangeSet<TObject>> other, IEqualityComparer<TObject>? equalityComparer = null, IScheduler? scheduler = null, bool completable = true) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The Source Observable ChangeSet.

other IObservable<IChangeSet<TObject>>

The Other Observable ChangeSet.

equalityComparer IEqualityComparer<TObject>

IEqualityComparer<T> instance to determine if two elements are the same.

scheduler IScheduler

(Optional) System.Reactive.Concurrency.IScheduler instance to use when enumerating the collection.

completable bool

Whether or not the result Observable should complete if all the changesets complete.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject>(IObservable<IObservable<IChangeSet<TObject>>>, IEqualityComparer<TObject>?)

Operator similiar to Merge except it is ChangeSet aware. All of the observable changesets are merged together into a single stream of ChangeSet events.

public static IObservable<IChangeSet<TObject>> MergeChangeSets<TObject>(this IObservable<IObservable<IChangeSet<TObject>>> source, IEqualityComparer<TObject>? equalityComparer = null) where TObject : notnull

Parameters

source IObservable<IObservable<IChangeSet<TObject>>>

The Source Observable ChangeSet.

equalityComparer IEqualityComparer<TObject>

IEqualityComparer<T> instance to determine if two elements are the same.

Returns

IObservable<IChangeSet<TObject>>

The result from merging the changesets together.

Type Parameters

TObject

The type of the object.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject, TKey>(IObservableList<IObservable<IChangeSet<TObject, TKey>>>, IComparer<TObject>)

Merges each Observable ChangeSet in the ObservableList into a single stream of ChangeSets that correctly handles multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TObject, TKey>> MergeChangeSets<TObject, TKey>(this IObservableList<IObservable<IChangeSet<TObject, TKey>>> source, IComparer<TObject> comparer) where TObject : notnull where TKey : notnull

Parameters

source IObservableList<IObservable<IChangeSet<TObject, TKey>>>

The SourceList of Observable Cache ChangeSets.

comparer IComparer<TObject>

IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TObject, TKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TKey

The type of the object key.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject, TKey>(IObservableList<IObservable<IChangeSet<TObject, TKey>>>, IEqualityComparer<TObject>?, IComparer<TObject>?)

Merges all of the Cache Observable ChangeSets into a single ChangeSets while correctly handling multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TObject, TKey>> MergeChangeSets<TObject, TKey>(this IObservableList<IObservable<IChangeSet<TObject, TKey>>> source, IEqualityComparer<TObject>? equalityComparer = null, IComparer<TObject>? comparer = null) where TObject : notnull where TKey : notnull

Parameters

source IObservableList<IObservable<IChangeSet<TObject, TKey>>>

The SourceList of Observable Cache ChangeSets.

equalityComparer IEqualityComparer<TObject>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

comparer IComparer<TObject>

Optional IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TObject, TKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TKey

The type of the object key.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject, TKey>(IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>>, IComparer<TObject>)

Merges all of the Cache Observable ChangeSets into a single ChangeSets while correctly handling multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TObject, TKey>> MergeChangeSets<TObject, TKey>(this IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>> source, IComparer<TObject> comparer) where TObject : notnull where TKey : notnull

Parameters

source IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>>

The List Observable ChangeSet of Cache Observable ChangeSets.

comparer IComparer<TObject>

IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TObject, TKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TKey

The type of the object key.

Exceptions

ArgumentNullException

Parameter was null.

MergeChangeSets<TObject, TKey>(IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>>, IEqualityComparer<TObject>?, IComparer<TObject>?)

Merges each Observable ChangeSet in the ObservableList into a single stream of ChangeSets that correctly handles multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TObject, TKey>> MergeChangeSets<TObject, TKey>(this IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>> source, IEqualityComparer<TObject>? equalityComparer = null, IComparer<TObject>? comparer = null) where TObject : notnull where TKey : notnull

Parameters

source IObservable<IChangeSet<IObservable<IChangeSet<TObject, TKey>>>>

The List Observable ChangeSet of Cache Observable ChangeSets.

equalityComparer IEqualityComparer<TObject>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

comparer IComparer<TObject>

Optional IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TObject, TKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TKey

The type of the object key.

Exceptions

ArgumentNullException

Parameter was null.

MergeManyChangeSets<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination>>>, IEqualityComparer<TDestination>?)

Operator similiar to MergeMany except it is List ChangeSet aware. It uses observableSelector to transform each item in the source into a child IChangeSet<TObject> and merges the result children together into a single stream of ChangeSets that correctly handles removal of the parent items and other changes to the source list.

public static IObservable<IChangeSet<TDestination>> MergeManyChangeSets<TObject, TDestination>(this IObservable<IChangeSet<TObject>> source, Func<TObject, IObservable<IChangeSet<TDestination>>> observableSelector, IEqualityComparer<TDestination>? equalityComparer = null) where TObject : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The Source Observable ChangeSet.

observableSelector Func<TObject, IObservable<IChangeSet<TDestination>>>

Factory Function used to create child changesets.

equalityComparer IEqualityComparer<TDestination>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

Returns

IObservable<IChangeSet<TDestination>>

The result from merging the children list changesets together.

Type Parameters

TObject

The type of the object.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

Parameter was null.

MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IComparer<TDestination>)

Operator similiar to MergeMany except it is Cache ChangeSet aware. It uses observableSelector to transform each item in the source into a child IChangeSet<TObject, TKey> and merges the result children together into a single stream of ChangeSets that correctly handles multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TDestination, TDestinationKey>> MergeManyChangeSets<TObject, TDestination, TDestinationKey>(this IObservable<IChangeSet<TObject>> source, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>> observableSelector, IComparer<TDestination> comparer) where TObject : notnull where TDestination : notnull where TDestinationKey : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The Source Observable ChangeSet.

observableSelector Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>

Factory Function used to create child changesets.

comparer IComparer<TDestination>

IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TDestination, TDestinationKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TDestination

The type of the destination.

TDestinationKey

The type of the destination key.

Exceptions

ArgumentNullException

Parameter was null.

MergeManyChangeSets<TObject, TDestination, TDestinationKey>(IObservable<IChangeSet<TObject>>, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>, IEqualityComparer<TDestination>?, IComparer<TDestination>?)

Operator similiar to MergeMany except it is Cache ChangeSet aware. It uses observableSelector to transform each item in the source into a child IChangeSet<TObject, TKey> and merges the result children together into a single stream of ChangeSets that correctly handles multiple Keys and removal of the parent items.

public static IObservable<IChangeSet<TDestination, TDestinationKey>> MergeManyChangeSets<TObject, TDestination, TDestinationKey>(this IObservable<IChangeSet<TObject>> source, Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>> observableSelector, IEqualityComparer<TDestination>? equalityComparer = null, IComparer<TDestination>? comparer = null) where TObject : notnull where TDestination : notnull where TDestinationKey : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The Source Observable ChangeSet.

observableSelector Func<TObject, IObservable<IChangeSet<TDestination, TDestinationKey>>>

Factory Function used to create child changesets.

equalityComparer IEqualityComparer<TDestination>

Optional IEqualityComparer<T> instance to determine if two elements are the same.

comparer IComparer<TDestination>

Optional IComparer<T> instance to determine which element to emit if the same key is emitted from multiple child changesets.

Returns

IObservable<IChangeSet<TDestination, TDestinationKey>>

The result from merging the child changesets together.

Type Parameters

TObject

The type of the object.

TDestination

The type of the destination.

TDestinationKey

The type of the destination key.

Exceptions

ArgumentNullException

Parameter was null.

MergeMany<T, TDestination>(IObservable<IChangeSet<T>>, Func<T, IObservable<TDestination>>)

Dynamically merges the observable which is selected from each item in the stream, and un-merges the item when it is no longer part of the stream.

public static IObservable<TDestination> MergeMany<T, TDestination>(this IObservable<IChangeSet<T>> source, Func<T, IObservable<TDestination>> observableSelector) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

observableSelector Func<T, IObservable<TDestination>>

The observable selector.

Returns

IObservable<TDestination>

An observable which emits the destination value.

Type Parameters

T

The type of the object.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or observableSelector.

NotEmpty<T>(IObservable<IChangeSet<T>>)

Prevents an empty notification.

public static IObservable<IChangeSet<T>> NotEmpty<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source.

OnItemAdded<T>(IObservable<IChangeSet<T>>, Action<T>)

Callback for each item as and when it is being added to the stream.

public static IObservable<IChangeSet<T>> OnItemAdded<T>(this IObservable<IChangeSet<T>> source, Action<T> addAction) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

addAction Action<T>

The add action.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

OnItemRefreshed<TObject>(IObservable<IChangeSet<TObject>>, Action<TObject>)

Callback for each item as and when it is being refreshed in the stream.

public static IObservable<IChangeSet<TObject>> OnItemRefreshed<TObject>(this IObservable<IChangeSet<TObject>> source, Action<TObject> refreshAction) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

refreshAction Action<TObject>

The refresh action.

Returns

IObservable<IChangeSet<TObject>>

An observable which emits a change set with items being added.

Type Parameters

TObject

The type of the object.

OnItemRemoved<T>(IObservable<IChangeSet<T>>, Action<T>, bool)

Callback for each item as and when it is being removed from the stream.

public static IObservable<IChangeSet<T>> OnItemRemoved<T>(this IObservable<IChangeSet<T>> source, Action<T> removeAction, bool invokeOnUnsubscribe = true) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

removeAction Action<T>

The remove action.

invokeOnUnsubscribe bool

Should the remove action be invoked when the subscription is disposed.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or removeAction.

Or<T>(IObservableList<IObservableList<T>>)

Dynamically apply a logical Or operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Or<T>(this IObservableList<IObservableList<T>> sources) where T : notnull

Parameters

sources IObservableList<IObservableList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Or<T>(IObservableList<ISourceList<T>>)

Dynamically apply a logical Or operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Or<T>(this IObservableList<ISourceList<T>> sources) where T : notnull

Parameters

sources IObservableList<ISourceList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Or<T>(IObservableList<IObservable<IChangeSet<T>>>)

Dynamically apply a logical Or operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Or<T>(this IObservableList<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources IObservableList<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Or<T>(ICollection<IObservable<IChangeSet<T>>>)

Apply a logical Or operator between the collections. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Or<T>(this ICollection<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources ICollection<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Or<T>(IObservable<IChangeSet<T>>, params IObservable<IChangeSet<T>>[])

Apply a logical Or operator between the collections. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Or<T>(this IObservable<IChangeSet<T>> source, params IObservable<IChangeSet<T>>[] others) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

others IObservable<IChangeSet<T>>[]

The others.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Page<T>(IObservable<IChangeSet<T>>, IObservable<IPageRequest>)

Applies paging to the data source.

public static IObservable<IPageChangeSet<T>> Page<T>(this IObservable<IChangeSet<T>> source, IObservable<IPageRequest> requests) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

requests IObservable<IPageRequest>

Observable to control page requests.

Returns

IObservable<IPageChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

PopulateInto<T>(IObservable<IChangeSet<T>>, ISourceList<T>)

list.

public static IDisposable PopulateInto<T>(this IObservable<IChangeSet<T>> source, ISourceList<T> destination) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

destination ISourceList<T>

The destination.

Returns

IDisposable

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or destination.

QueryWhenChanged<T>(IObservable<IChangeSet<T>>)

The latest copy of the cache is exposed for querying i) after each modification to the underlying data ii) upon subscription.

public static IObservable<IReadOnlyCollection<T>> QueryWhenChanged<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IReadOnlyCollection<T>>

An observable which emits the read only collection.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

QueryWhenChanged<TObject, TDestination>(IObservable<IChangeSet<TObject>>, Func<IReadOnlyCollection<TObject>, TDestination>)

The latest copy of the cache is exposed for querying after each modification to the underlying data.

public static IObservable<TDestination> QueryWhenChanged<TObject, TDestination>(this IObservable<IChangeSet<TObject>> source, Func<IReadOnlyCollection<TObject>, TDestination> resultSelector) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

resultSelector Func<IReadOnlyCollection<TObject>, TDestination>

The result selector.

Returns

IObservable<TDestination>

An observable which emits the destination value.

Type Parameters

TObject

The type of the object.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or resultSelector.

RefCount<T>(IObservable<IChangeSet<T>>)

List equivalent to Publish().RefCount(). The source is cached so long as there is at least 1 subscriber.

public static IObservable<IChangeSet<T>> RefCount<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

RemoveIndex<T>(IObservable<IChangeSet<T>>)

Removes the index from all changes.

NB: This operator has been introduced as a temporary fix for creating an Or operator using merge many.

public static IObservable<IChangeSet<T>> RemoveIndex<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Reverse<T>(IObservable<IChangeSet<T>>)

Reverse sort of the change set.

public static IObservable<IChangeSet<T>> Reverse<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or comparer.

SkipInitial<T>(IObservable<IChangeSet<T>>)

Defer the subscription until loaded and skip initial change set.

public static IObservable<IChangeSet<T>> SkipInitial<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source.

Sort<T>(IObservable<IChangeSet<T>>, IComparer<T>, SortOptions, IObservable<Unit?>?, IObservable<IComparer<T>>?, int)

Sorts the sequence using the specified comparer.

public static IObservable<IChangeSet<T>> Sort<T>(this IObservable<IChangeSet<T>> source, IComparer<T> comparer, SortOptions options = SortOptions.None, IObservable<Unit?>? resort = null, IObservable<IComparer<T>>? comparerChanged = null, int resetThreshold = 50) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

comparer IComparer<T>

The comparer used for sorting.

options SortOptions

For improved performance, specify SortOptions.UseBinarySearch. This can only be used when the values which are sorted on are immutable.

resort IObservable<Unit>

OnNext of this observable causes data to resort. This is required when the value which is sorted on mutable.

comparerChanged IObservable<IComparer<T>>

An observable comparer used to change the comparer on which the sorted list i.

resetThreshold int

Since sorting can be slow for large record sets, the reset threshold is used to force the list re-ordered.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or comparer.

Sort<T>(IObservable<IChangeSet<T>>, IObservable<IComparer<T>>, SortOptions, IObservable<Unit?>?, int)

Sorts the sequence using the specified observable comparer.

public static IObservable<IChangeSet<T>> Sort<T>(this IObservable<IChangeSet<T>> source, IObservable<IComparer<T>> comparerChanged, SortOptions options = SortOptions.None, IObservable<Unit?>? resort = null, int resetThreshold = 50) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

comparerChanged IObservable<IComparer<T>>

An observable comparer used to change the comparer on which the sorted list i.

options SortOptions

For improved performance, specify SortOptions.UseBinarySearch. This can only be used when the values which are sorted on are immutable.

resort IObservable<Unit>

OnNext of this observable causes data to resort. This is required when the value which is sorted on mutable.

resetThreshold int

Since sorting can be slow for large record sets, the reset threshold is used to force the list re-ordered.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentNullException

source or comparer.

StartWithEmpty<T>(IObservable<IChangeSet<T>>)

Prepends an empty change set to the source.

public static IObservable<IChangeSet<T>> StartWithEmpty<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source observable of change set values.

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of item.

SubscribeMany<T>(IObservable<IChangeSet<T>>, Func<T, IDisposable>)

Subscribes to each item when it is added to the stream and unsubscribes when it is removed. All items will be unsubscribed when the stream is disposed.

public static IObservable<IChangeSet<T>> SubscribeMany<T>(this IObservable<IChangeSet<T>> source, Func<T, IDisposable> subscriptionFactory) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

subscriptionFactory Func<T, IDisposable>

The subscription function.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Remarks

Subscribes to each item when it is added or updates and unsubscribes when it is removed.

Exceptions

ArgumentNullException

source or subscriptionFactory.

SuppressRefresh<T>(IObservable<IChangeSet<T>>)

Suppress refresh notifications.

public static IObservable<IChangeSet<T>> SuppressRefresh<T>(this IObservable<IChangeSet<T>> source) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source observable change set.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the object.

Switch<T>(IObservable<IObservableList<T>>)

Transforms an observable sequence of observable lists into a single sequence producing values only from the most recent observable sequence. Each time a new inner observable sequence is received, unsubscribe from the previous inner observable sequence and clear the existing result set.

public static IObservable<IChangeSet<T>> Switch<T>(this IObservable<IObservableList<T>> sources) where T : notnull

Parameters

sources IObservable<IObservableList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

sources is null.

Switch<T>(IObservable<IObservable<IChangeSet<T>>>)

Transforms an observable sequence of observable changes sets into an observable sequence producing values only from the most recent observable sequence. Each time a new inner observable sequence is received, unsubscribe from the previous inner observable sequence and clear the existing result set.

public static IObservable<IChangeSet<T>> Switch<T>(this IObservable<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources IObservable<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

sources is null.

ToCollection<TObject>(IObservable<IChangeSet<TObject>>)

Converts the change set into a fully formed collection. Each change in the source results in a new collection.

public static IObservable<IReadOnlyCollection<TObject>> ToCollection<TObject>(this IObservable<IChangeSet<TObject>> source) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

Returns

IObservable<IReadOnlyCollection<TObject>>

An observable which emits the read only collection.

Type Parameters

TObject

The type of the object.

ToObservableChangeSet<T>(IObservable<IEnumerable<T>>, Func<T, TimeSpan?>?, int, IScheduler?)

Converts the observable to an observable change set, allowing size and time limit to be specified. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<IEnumerable<T>> source, Func<T, TimeSpan?>? expireAfter, int limitSizeTo, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IEnumerable<T>>

The source.

expireAfter Func<T, TimeSpan?>

Specify on a per object level the maximum time before an object expires from a cache.

limitSizeTo int

Remove the oldest items when the size has reached this limit.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<IEnumerable<T>>, Func<T, TimeSpan?>, IScheduler?)

Converts the observable to an observable change set, allowing size to be specified. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<IEnumerable<T>> source, Func<T, TimeSpan?> expireAfter, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IEnumerable<T>>

The source.

expireAfter Func<T, TimeSpan?>

Specify on a per object level the maximum time before an object expires from a cache.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<IEnumerable<T>>, int, IScheduler?)

Converts the observable to an observable change set, allowing size and time limit to be specified. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<IEnumerable<T>> source, int limitSizeTo, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IEnumerable<T>>

The source.

limitSizeTo int

Remove the oldest items when the size has reached this limit.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<IEnumerable<T>>, IScheduler?)

Converts the observable to an observable change set. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<IEnumerable<T>> source, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<IEnumerable<T>>

The source.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<T>, Func<T, TimeSpan?>?, int, IScheduler?)

Converts the observable to an observable change set, allowing size and time limit to be specified. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<T> source, Func<T, TimeSpan?>? expireAfter, int limitSizeTo, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<T>

The source.

expireAfter Func<T, TimeSpan?>

Specify on a per object level the maximum time before an object expires from a cache.

limitSizeTo int

Remove the oldest items when the size has reached this limit. Supply -1 to disable size limiting.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<T>, Func<T, TimeSpan?>, IScheduler?)

Converts the observable to an observable change set, allowing time expiry to be specified. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<T> source, Func<T, TimeSpan?> expireAfter, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<T>

The source.

expireAfter Func<T, TimeSpan?>

Specify on a per object level the maximum time before an object expires from a cache.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<T>, int, IScheduler?)

Converts the observable to an observable change set, with a specified limit of how large the list can be. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<T> source, int limitSizeTo, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<T>

The source.

limitSizeTo int

Remove the oldest items when the size has reached this limit. Supply -1 to disable size limiting.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToObservableChangeSet<T>(IObservable<T>, IScheduler?)

Converts the observable to an observable change set. Change set observes observable change events.

public static IObservable<IChangeSet<T>> ToObservableChangeSet<T>(this IObservable<T> source, IScheduler? scheduler = null) where T : notnull

Parameters

source IObservable<T>

The source.

scheduler IScheduler

The scheduler (only used for time expiry).

Returns

IObservable<IChangeSet<T>>

An observable which emits a change set.

Type Parameters

T

The type of the object.

Exceptions

ArgumentNullException

source or keySelector.

ToSortedCollection<TObject>(IObservable<IChangeSet<TObject>>, IComparer<TObject>)

Converts the change set into a fully formed sorted collection. Each change in the source results in a new sorted collection.

public static IObservable<IReadOnlyCollection<TObject>> ToSortedCollection<TObject>(this IObservable<IChangeSet<TObject>> source, IComparer<TObject> comparer) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

comparer IComparer<TObject>

The sort comparer.

Returns

IObservable<IReadOnlyCollection<TObject>>

An observable which emits the read only collection.

Type Parameters

TObject

The type of the object.

ToSortedCollection<TObject, TSortKey>(IObservable<IChangeSet<TObject>>, Func<TObject, TSortKey>, SortDirection)

Converts the change set into a fully formed sorted collection. Each change in the source results in a new sorted collection.

public static IObservable<IReadOnlyCollection<TObject>> ToSortedCollection<TObject, TSortKey>(this IObservable<IChangeSet<TObject>> source, Func<TObject, TSortKey> sort, SortDirection sortOrder = SortDirection.Ascending) where TObject : notnull

Parameters

source IObservable<IChangeSet<TObject>>

The source.

sort Func<TObject, TSortKey>

The sort function.

sortOrder SortDirection

The sort order. Defaults to ascending.

Returns

IObservable<IReadOnlyCollection<TObject>>

An observable which emits the read only collection.

Type Parameters

TObject

The type of the object.

TSortKey

The sort key.

Top<T>(IObservable<IChangeSet<T>>, int)

Limits the size of the result set to the specified number of items.

public static IObservable<IChangeSet<T>> Top<T>(this IObservable<IChangeSet<T>> source, int numberOfItems) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

numberOfItems int

The number of items.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

TransformAsync<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Optional<TDestination>, int, Task<TDestination>>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> TransformAsync<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, Optional<TDestination>, int, Task<TDestination>> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, Optional<TDestination>, int, Task<TDestination>>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

TransformAsync<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Optional<TDestination>, Task<TDestination>>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> TransformAsync<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, Optional<TDestination>, Task<TDestination>> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, Optional<TDestination>, Task<TDestination>>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

TransformAsync<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, int, Task<TDestination>>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> TransformAsync<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, int, Task<TDestination>> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, int, Task<TDestination>>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

TransformAsync<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Task<TDestination>>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> TransformAsync<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, Task<TDestination>> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, Task<TDestination>>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, IObservableList<TDestination>>, IEqualityComparer<TDestination>?)

Flatten the nested observable list, and observe subsequent observable collection changes.

public static IObservable<IChangeSet<TDestination>> TransformMany<TDestination, TSource>(this IObservable<IChangeSet<TSource>> source, Func<TSource, IObservableList<TDestination>> manySelector, IEqualityComparer<TDestination>? equalityComparer = null) where TDestination : notnull where TSource : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

manySelector Func<TSource, IObservableList<TDestination>>

The selector function which selects the enumerable.

equalityComparer IEqualityComparer<TDestination>

Used when an item has been replaced to determine whether child items are the same as previous children.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TDestination

The type of the destination.

TSource

The type of the source.

TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, IEnumerable<TDestination>>, IEqualityComparer<TDestination>?)

Equivalent to a select many transform. To work, the key must individually identify each child.

public static IObservable<IChangeSet<TDestination>> TransformMany<TDestination, TSource>(this IObservable<IChangeSet<TSource>> source, Func<TSource, IEnumerable<TDestination>> manySelector, IEqualityComparer<TDestination>? equalityComparer = null) where TDestination : notnull where TSource : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

manySelector Func<TSource, IEnumerable<TDestination>>

The selector function which selects the enumerable.

equalityComparer IEqualityComparer<TDestination>

Used when an item has been replaced to determine whether child items are the same as previous children.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TDestination

The type of the destination.

TSource

The type of the source.

Exceptions

ArgumentNullException

source or manySelector.

TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, ObservableCollection<TDestination>>, IEqualityComparer<TDestination>?)

Flatten the nested observable collection, and observe subsequently observable collection changes.

public static IObservable<IChangeSet<TDestination>> TransformMany<TDestination, TSource>(this IObservable<IChangeSet<TSource>> source, Func<TSource, ObservableCollection<TDestination>> manySelector, IEqualityComparer<TDestination>? equalityComparer = null) where TDestination : notnull where TSource : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

manySelector Func<TSource, ObservableCollection<TDestination>>

The selector function which selects the enumerable.

equalityComparer IEqualityComparer<TDestination>

Used when an item has been replaced to determine whether child items are the same as previous children.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TDestination

The type of the destination.

TSource

The type of the source.

TransformMany<TDestination, TSource>(IObservable<IChangeSet<TSource>>, Func<TSource, ReadOnlyObservableCollection<TDestination>>, IEqualityComparer<TDestination>?)

Flatten the nested observable collection, and observe subsequently observable collection changes.

public static IObservable<IChangeSet<TDestination>> TransformMany<TDestination, TSource>(this IObservable<IChangeSet<TSource>> source, Func<TSource, ReadOnlyObservableCollection<TDestination>> manySelector, IEqualityComparer<TDestination>? equalityComparer = null) where TDestination : notnull where TSource : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

manySelector Func<TSource, ReadOnlyObservableCollection<TDestination>>

The selector function which selects the enumerable.

equalityComparer IEqualityComparer<TDestination>

Used when an item has been replaced to determine whether child items are the same as previous children.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TDestination

The type of the destination.

TSource

The type of the source.

Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Optional<TDestination>, int, TDestination>, bool)

Projects each update item to a new form using the specified transform function.

*** Annoyingly when using this overload you will have to explicitly specify the generic type arguments as type inference fails.

public static IObservable<IChangeSet<TDestination>> Transform<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, Optional<TDestination>, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, Optional<TDestination>, int, TDestination>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, Optional<TDestination>, TDestination>, bool)

Projects each update item to a new form using the specified transform function.

*** Annoyingly when using this overload you will have to explicitly specify the generic type arguments as type inference fails.

public static IObservable<IChangeSet<TDestination>> Transform<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, Optional<TDestination>, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, Optional<TDestination>, TDestination>

The transform function.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, int, TDestination>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> Transform<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, int, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, int, TDestination>

The transform function.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

A an observable change set of the transformed object.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

Transform<TSource, TDestination>(IObservable<IChangeSet<TSource>>, Func<TSource, TDestination>, bool)

Projects each update item to a new form using the specified transform function.

public static IObservable<IChangeSet<TDestination>> Transform<TSource, TDestination>(this IObservable<IChangeSet<TSource>> source, Func<TSource, TDestination> transformFactory, bool transformOnRefresh = false) where TSource : notnull where TDestination : notnull

Parameters

source IObservable<IChangeSet<TSource>>

The source.

transformFactory Func<TSource, TDestination>

The transform factory.

transformOnRefresh bool

Should a new transform be applied when a refresh event is received.

Returns

IObservable<IChangeSet<TDestination>>

An observable which emits the change set.

Type Parameters

TSource

The type of the source.

TDestination

The type of the destination.

Exceptions

ArgumentNullException

source or valueSelector.

Virtualise<T>(IObservable<IChangeSet<T>>, IObservable<IVirtualRequest>)

Virtualises the source using parameters provided via the requests observable.

public static IObservable<IVirtualChangeSet<T>> Virtualise<T>(this IObservable<IChangeSet<T>> source, IObservable<IVirtualRequest> requests) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

requests IObservable<IVirtualRequest>

The requests.

Returns

IObservable<IVirtualChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

WhenAnyPropertyChanged<TObject>(IObservable<IChangeSet<TObject>>, params string[])

Watches each item in the collection and notifies when any of them has changed.

public static IObservable<TObject?> WhenAnyPropertyChanged<TObject>(this IObservable<IChangeSet<TObject>> source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertiesToMonitor string[]

specify properties to Monitor, or omit to monitor all property changes.

Returns

IObservable<TObject>

An observable which emits the object.

Type Parameters

TObject

The type of the object.

WhenPropertyChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool)

Watches each item in the collection and notifies when any of them has changed.

public static IObservable<PropertyValue<TObject, TValue>> WhenPropertyChanged<TObject, TValue>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TValue>> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertyAccessor Expression<Func<TObject, TValue>>

The property accessor.

notifyOnInitialValue bool

If true the resulting observable includes the initial value.

Returns

IObservable<PropertyValue<TObject, TValue>>

An observable which emits the property value.

Type Parameters

TObject

The type of object.

TValue

The type of the value.

WhenValueChanged<TObject, TValue>(IObservable<IChangeSet<TObject>>, Expression<Func<TObject, TValue>>, bool)

Watches each item in the collection and notifies when any of them has changed.

public static IObservable<TValue?> WhenValueChanged<TObject, TValue>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TValue>> propertyAccessor, bool notifyOnInitialValue = true) where TObject : INotifyPropertyChanged

Parameters

source IObservable<IChangeSet<TObject>>

The source.

propertyAccessor Expression<Func<TObject, TValue>>

The property accessor.

notifyOnInitialValue bool

If true the resulting observable includes the initial value.

Returns

IObservable<TValue>

An observable which emits the value.

Type Parameters

TObject

The type of object.

TValue

The type of the value.

WhereReasonsAreNot<T>(IObservable<IChangeSet<T>>, params ListChangeReason[])

Excludes updates for the specified reasons.

public static IObservable<IChangeSet<T>> WhereReasonsAreNot<T>(this IObservable<IChangeSet<T>> source, params ListChangeReason[] reasons) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

reasons ListChangeReason[]

The reasons.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentException

Must enter at least 1 reason.

WhereReasonsAre<T>(IObservable<IChangeSet<T>>, params ListChangeReason[])

Includes changes for the specified reasons only.

public static IObservable<IChangeSet<T>> WhereReasonsAre<T>(this IObservable<IChangeSet<T>> source, params ListChangeReason[] reasons) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

reasons ListChangeReason[]

The reasons.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Exceptions

ArgumentException

Must enter at least 1 reason.

Xor<T>(IObservableList<IObservableList<T>>)

Dynamically apply a logical Xor operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Xor<T>(this IObservableList<IObservableList<T>> sources) where T : notnull

Parameters

sources IObservableList<IObservableList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Xor<T>(IObservableList<ISourceList<T>>)

Dynamically apply a logical Xor operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Xor<T>(this IObservableList<ISourceList<T>> sources) where T : notnull

Parameters

sources IObservableList<ISourceList<T>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Xor<T>(IObservableList<IObservable<IChangeSet<T>>>)

Dynamically apply a logical Xor operator between the items in the outer observable list. Items which are in any of the sources are included in the result.

public static IObservable<IChangeSet<T>> Xor<T>(this IObservableList<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources IObservableList<IObservable<IChangeSet<T>>>

The source.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Xor<T>(ICollection<IObservable<IChangeSet<T>>>)

Apply a logical Xor operator between the collections. Items which are only in one of the sources are included in the result.

public static IObservable<IChangeSet<T>> Xor<T>(this ICollection<IObservable<IChangeSet<T>>> sources) where T : notnull

Parameters

sources ICollection<IObservable<IChangeSet<T>>>

The sources.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.

Xor<T>(IObservable<IChangeSet<T>>, params IObservable<IChangeSet<T>>[])

Apply a logical Xor operator between the collections. Items which are only in one of the sources are included in the result.

public static IObservable<IChangeSet<T>> Xor<T>(this IObservable<IChangeSet<T>> source, params IObservable<IChangeSet<T>>[] others) where T : notnull

Parameters

source IObservable<IChangeSet<T>>

The source.

others IObservable<IChangeSet<T>>[]

The others.

Returns

IObservable<IChangeSet<T>>

An observable which emits the change set.

Type Parameters

T

The type of the item.