CoreDispatcherObservable
using System.Reactive.Concurrency;
using System.Runtime.CompilerServices;
using Windows.UI.Core;
namespace System.Reactive.Linq
{
[NullableContext(1)]
[Nullable(0)]
[CLSCompliant(false)]
public static class CoreDispatcherObservable
{
public static IObservable<TSource> ObserveOn<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
{
if (source == null)
throw new ArgumentNullException("source");
if (dispatcher == (CoreDispatcher)null)
throw new ArgumentNullException("dispatcher");
return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher));
}
public static IObservable<TSource> ObserveOn<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
{
if (source == null)
throw new ArgumentNullException("source");
if (dispatcher == (CoreDispatcher)null)
throw new ArgumentNullException("dispatcher");
return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher, priority));
}
public static IObservable<TSource> ObserveOnCoreDispatcher<[Nullable(2)] TSource>(this IObservable<TSource> source)
{
if (source == null)
throw new ArgumentNullException("source");
return Synchronization.ObserveOn(source, CoreDispatcherScheduler.Current);
}
public static IObservable<TSource> ObserveOnDispatcher<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
{
if (source == null)
throw new ArgumentNullException("source");
return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
}
public static IObservable<TSource> SubscribeOn<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
{
if (source == null)
throw new ArgumentNullException("source");
if (dispatcher == (CoreDispatcher)null)
throw new ArgumentNullException("dispatcher");
return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher));
}
public static IObservable<TSource> SubscribeOn<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
{
if (source == null)
throw new ArgumentNullException("source");
if (dispatcher == (CoreDispatcher)null)
throw new ArgumentNullException("dispatcher");
return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher, priority));
}
public static IObservable<TSource> SubscribeOnCoreDispatcher<[Nullable(2)] TSource>(this IObservable<TSource> source)
{
if (source == null)
throw new ArgumentNullException("source");
return Synchronization.SubscribeOn(source, CoreDispatcherScheduler.Current);
}
public static IObservable<TSource> SubscribeOnDispatcher<[Nullable(2)] TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
{
if (source == null)
throw new ArgumentNullException("source");
return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
}
}
}