Helper context to mimic constrained synchronization contexts. Obtained from: http://stackoverflow.com/questions/1882417/looking-for-an-example-of-a-custom-synchronizationcontext
Inheritance: IDisposable
Example #1
0
 public static void Invoke(Func<Task> action)
 {
     var helper = new SyncContextHelper();
     var task = helper._dispatcher.Invoke(action);
     task.Wait();
     helper.Dispose();
 }
Example #2
0
 public static void Invoke(Action action)
 {
     var helper = new SyncContextHelper();
     helper._dispatcher.Invoke(action);
     helper.Dispose();
 }