コード例 #1
0
        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;
            }
        }
コード例 #2
0
 bool CanPerform(CanPerformMethod method)
 {
     bool result;
     if (method(out result) != 0)
         return false;
     return result;
 }
コード例 #3
0
 bool CanPerform(CanPerformMethod method)
 {
     return method();
 }