bool CanPerform(CanPerformMethod method)
{
// in xulrunner (tested on version 5.0)
// nsIController.IsCommandEnabled("cmd_copyImageContents") can return E_FAIL when clicking on certain objects.
// this seems to me like a xulrunner bug.
try
{
return method();
}
catch (COMException e)
{
if ((e.ErrorCode & 0xFFFFFFFF) != 0x80004005)
throw e;
return false;
}
}