Пример #1
0
 public void ExecuteAsynchronous(IObserverAsynchronousExecution observer)
 {
     // O parâmetro observer representa a interface gráfica que executará este método
     // de forma assíncrona
     if (AsynchronousExecution != null)
     {
         try
         {
             this._observer = observer;
             observer.ConfigureBeforeAsynchronousExecution();
             AsynchronousExecution();
             observer.AsynchronousExecutionFinished();
         }
         catch (Exception ex)
         {
             if (AsynchronousExecutionAborted != null)
                 AsynchronousExecutionAborted(ex);
             observer.AsynchronousExecutionAborted(ex);
         }
     }
 }
Пример #2
0
 public void ExecuteAsynchronous(IObserverAsynchronousExecution observer)
 {
     // O parâmetro observer representa a interface gráfica que executará este método
     // de forma assíncrona
     if (AsynchronousExecution != null)
     {
         try
         {
             this._observer = observer;
             observer.ConfigureBeforeAsynchronousExecution();
             AsynchronousExecution();
             observer.AsynchronousExecutionFinished();
         }
         catch (Exception ex)
         {
             if (AsynchronousExecutionAborted != null)
             {
                 AsynchronousExecutionAborted(ex);
             }
             observer.AsynchronousExecutionAborted(ex);
         }
     }
 }