ThreadPoolTimerExtensions
using System.Reactive.Disposables;
using System.Runtime.CompilerServices;
using Windows.Foundation;
using Windows.System.Threading;
namespace System.Reactive.Concurrency
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal static class ThreadPoolTimerExtensions
{
public static IDisposable AsDisposable(this ThreadPoolTimer threadPoolTimer)
{
return Disposable.Create(threadPoolTimer, delegate(ThreadPoolTimer t) {
t.Cancel();
});
}
public static IDisposable AsDisposable(this IAsyncInfo asyncInfo)
{
return Disposable.Create(asyncInfo, delegate(IAsyncInfo i) {
i.Cancel();
});
}
}
}