Как виджеты Google+ +1 выходят из своего iframe?

Не то, что я знаю. Это громоздко, но он полностью определяет вас как намерение разработчика:

private bool inException = false;

public void MyFunc1()
{
  try
  {
    inException = false;

    // some code here that eventaully throws an exception
  }
  catch( Exception ex )
  {
     inException = true;
     Helper();
  }
}

public void MyFunc2()
{
   inException = false;
   Helper();
}

private void Helper()
{
    // how can I check if program execution is the  
    // result of a thrown exception here.
    if (inException)
    {
        // do things.
    }
}
145
задан Laurel 26 April 2016 в 22:42
поделиться