Class ControlObservable
Provides a set of static methods for subscribing to IObservables using Windows Forms controls.
public static class ControlObservable
- Inheritance
-
ControlObservable
Methods
ObserveOn<TSource>(IObservable<TSource>, Control)
Wraps the source sequence in order to run its observer callbacks on the Windows Forms message loop associated with the specified control.
public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, Control control)
Parameters
source
IObservable<TSource>Source sequence.
control
ControlWindows Forms control whose associated message loop is used to notify observers on.
Returns
- IObservable<TSource>
The source sequence whose observations happen on the Windows Forms message loop associated with the specified control.
Type Parameters
TSource
The type of the elements in the source sequence.
Exceptions
- ArgumentNullException
source
orcontrol
is null.
SubscribeOn<TSource>(IObservable<TSource>, Control)
Wraps the source sequence in order to run its subscription and unsubscription logic on the Windows Forms message loop associated with the specified control.
public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Control control)
Parameters
source
IObservable<TSource>Source sequence.
control
ControlWindows Forms control whose associated message loop is used to perform subscription and unsubscription actions on.
Returns
- IObservable<TSource>
The source sequence whose subscriptions and unsubscriptions happen on the Windows Forms message loop associated with the specified control.
Type Parameters
TSource
The type of the elements in the source sequence.
Remarks
Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified control. In order to invoke observer callbacks on the specified control, e.g. to render results in a control, use ObserveOn<TSource>(IObservable<TSource>, Control).
Exceptions
- ArgumentNullException
source
orcontrol
is null.