Ejemplo n.º 1
0
 private void Cron_OnCronTrigger(CronObject cronObject)
 {
     if (cronObject == null)
     {
         return;
     }
     // ReSharper disable once AssignNullToNotNullAttribute
     try
     {
         var cronObjectHelper = (CronObjectHelper)cronObject.Object;
         var task             = Activator.CreateInstance(cronObjectHelper.TaskType) as TaskBase;
         task?.ExecuteTask(cronObjectHelper.GroupName,
                           (bool)_serviceSettings.GetPropertyValue(ServiceSettings.GetSettingNameReport(task, cronObjectHelper.GroupName)),
                           (int)_serviceSettings.GetPropertyValue(ServiceSettings.GetSettingNameSendReportInterval(task, cronObjectHelper.GroupName)) * 60,
                           (System.Diagnostics.EventLogEntryType)_serviceSettings.GetPropertyValue(ServiceSettings.GetSettingNameReportInformationLevel(task, cronObjectHelper.GroupName)),
                           (uint)_serviceSettings.GetPropertyValue(ServiceSettings.GetSettingNameMaxErrorCount(task, cronObjectHelper.GroupName)));
     }
     catch (Exception e) { _serviceLogger.CreateLogRecord(e); }
 }