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; } }
bool CanPerform(CanPerformMethod method) { bool result; if (method(out result) != 0) return false; return result; }
bool CanPerform(CanPerformMethod method) { return method(); }