Skip to content

Instantly share code, notes, and snippets.

Created October 29, 2010 18:35
Show Gist options
  • Save anonymous/654100 to your computer and use it in GitHub Desktop.
Save anonymous/654100 to your computer and use it in GitHub Desktop.
Action cont1 = ...;
Action cont2 = ...;
Task.Factory.StartNew(some-synchronous-computation)
.ContinueWith(t =>
{
t.Result ? cont1() : cont2();
}, TaskScheduler.FromCurrentSynchronizationContext());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment