Exemplo n.º 1
0
 private void RunIdleUIJobSync(IIdleUIJob job)
 {
     // Run the job. If the job fails, ignore that exception as well but log it too!
     try
     {
         job.Run();
     }
     catch (Exception ex)
     {
         // Be careful when processing the jobs, we don't want a malicious job to terminate the process!
         Logger.Instance.LogFormat(LogType.Warning, this, $"An error occurred while processing UI-job '{job.GetType().Name}'!");
         Logger.Instance.LogException(this, ex);
     }
 }
Exemplo n.º 2
0
 private void RunIdleUIJobAsync(IIdleUIJob job)
 {
     ThreadPool.QueueUserWorkItem(o =>
     {
         // Run the job. If the job fails, ignore that exception as well but log it too!
         try
         {
             job.Run();
         }
         catch (Exception ex)
         {
             // Be careful when processing the jobs, we don't want a malicious job to terminate the process!
             Logger.Instance.LogFormat(LogType.Warning, this, string.Format("An error occurred while processing the asynchronous UI-job '{0}'!", job.GetType().Name));
             Logger.Instance.LogException(this, ex);
         }
     });
 }
 private void RunIdleUIJobSync(IIdleUIJob job)
 {
     // Run the job. If the job fails, ignore that exception as well but log it too!
     try
     {
         job.Run();
     }
     catch (Exception ex)
     {
         // Be careful when processing the jobs, we don't want a malicious job to terminate the process!
         Logger.Instance.LogFormat(LogType.Warning, this, string.Format("An error occurred while processing UI-job '{0}'!", job.GetType().Name));
         Logger.Instance.LogException(this, ex);
     }
 }