Exemplo n.º 1
0
 private void PerformMonitorAction(string options, string callbackId, string caller, MonitorActionWithResult action)
 {
     try
     {
         PluginResult result = null;
         if (_monitor == null)
         {
             LogMessage(string.Format("{0} ignored; monitor has not been created yet", caller));
         }
         else
         {
             var args = ParseOptions(options);
             result = action(args);
         }
         if (result != null)
         {
             SendResult(callbackId, result);
         }
         else
         {
             SendResult(callbackId, PluginResult.Status.OK);
         }
     }
     catch (Exception ex)
     {
         LogError(string.Format("{0} failed: {1}", caller, ex.Message));
         SendResult(callbackId, PluginResult.Status.JSON_EXCEPTION);
     }
 }
 private void PerformMonitorAction(string options, string callbackId, string caller, MonitorActionWithResult action)
 {
     try
       {
     PluginResult result = null;
     if (_monitor == null)
     {
       LogMessage(string.Format("{0} ignored; monitor has not been created yet", caller));
     }
     else
     {
       var args = ParseOptions(options);
       result = action(args);
     }
     if (result != null)
       SendResult(callbackId, result);
     else
       SendResult(callbackId, PluginResult.Status.OK);
       }
       catch (Exception ex)
       {
     LogError(string.Format("{0} failed: {1}", caller, ex.Message));
     SendResult(callbackId, PluginResult.Status.JSON_EXCEPTION);
       }
 }