Nito.AsyncEx.SynchronizationContextSwitcher
Utility class for temporarily switching SynchronizationContext implementations.
namespace Nito.AsyncEx
{
public sealed class SynchronizationContextSwitcher
{
public static void NoContext(Action action);
public static T NoContext<T>(Func<T> action);
public static void ApplyContext(SynchronizationContext context, Action action);
public static T ApplyContext<T>(SynchronizationContext context, Func<T> action);
}
}