Example #1
0
 public void SendAlert(int level, AlertType type, Action <ISendAlertResult> callback)
 {
     try
     {
         IWebCall <TriggerAlertRequest, BaseResponse> webCall = mixWebCallFactory.IntegrationTestSupportUserAlertPost(new TriggerAlertRequest
         {
             Level = level.ToString(),
             Text  = AlertTypeUtils.ToString(type)
         });
         webCall.OnResponse += delegate
         {
             callback(new SendAlertResult(success: true));
         };
         webCall.OnError += delegate
         {
             callback(new SendAlertResult(success: false));
         };
         webCall.Execute();
     }
     catch (Exception ex)
     {
         logger.Critical("Unhandled exception: " + ex);
         callback(new SendAlertResult(success: false));
     }
 }