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