Esempio n. 1
0
 private string GetExceptionTempString(ExceptionTempInfo exception)
 {
     if (exception == null)
     {
         return("");
     }
     return(exception.Date + " " + exception.Exception);
 }
        private static void CheckException(ExceptionTempInfo exception)
        {
            if (exception == null || exception.Exception == null)
            {
                return;
            }
            var duration = DateTime.Now - exception.Date;

            if (duration < TimeSpan.FromMinutes(10))
            {
                throw exception.Exception;
            }
        }
 /// <summary>
 /// Сохраняет изменения в бесконечном цикле пока есть хоть 1 изменение
 /// </summary>
 protected void SaveChangesLoop()
 {
     try
     {
         while (true)
         {
             int count = SaveChanges();
             if (count == 0)
             {
                 return;
             }
         }
     }
     catch (ThreadAbortException)
     {
     }
     catch (Exception exception)
     {
         _lastSaveException = new ExceptionTempInfo(exception);
         ComponentControl.Log.Error("Ошибка SaveChangesLoop", exception);
         ComponentControl.AddApplicationError(exception);
     }
 }