love5an: (R)
Dmitry Ignatiev ([personal profile] love5an) wrote2013-07-02 06:05 am

Немного легкой утренней наркомании


public static void CallWithEscapeContinuation(Action<Action> f)
{
  var escapeTag = new Exception();
  Action escapeProcedure = () => { throw escapeTag; };
  try
  {
    f(escapeProcedure);
  }
  catch (Exception e)
  {
    if (ReferenceEquals(escapeTag, e)) return;
    throw;
  }
}


Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting