Пример #1
0
 /// <summary>
 /// Метод непосредственного создания отчета.
 /// </summary>
 public void MakeReport()
 {
     try
     {
         byte[] result = null;
         BuildTimer.Elapsed += (object source, ElapsedEventArgs e) =>
         {
             if (!Canceled)
             {
                 StopWorker(() => ReportWriter.ReportTimeout(Id));
             }
         };
         BuildTimer.Start();
         result = ReportBuilder.Build();
         if (!Canceled)
         {
             StopWorker(() => ReportWriter.ReportSuccess(result, Id));
         }
     }
     catch (Exception ex) when(ex.Message == "Report failed")
     {
         if (!Canceled)
         {
             StopWorker(() => ReportWriter.ReportError(Id));
         }
     }
 }