Nito.AsyncEx.SynchronizationContextSwitcher
Utility class for temporarily switching SynchronizationContext implementations.
Executes a synchronous delegate with the specified SynchronizationContext as "current". The previous current context is restored when this function returns.
Executes a synchronous or asynchronous delegate without the specified SynchronizationContext as "current". The previous current context is restored when this function synchronously returns.
Executes a synchronous delegate without the current SynchronizationContext. The current context is restored when this function returns.
Executes a synchronous or asynchronous delegate without the current SynchronizationContext. The current context is restored when this function synchronously returns.