Esempio n. 1
0
 private void _asyncTaskQueue_TaskError(TaskQueueErrorEventArgs eventArgs)
 {
     _windowManager.ShowTaskError(eventArgs);
     if (eventArgs.TaskQueueErrorResponse == TaskQueueErrorResponse.Abort)
     {
         this.Dispatcher.InvokeShutdown();
     }
 }
Esempio n. 2
0
        public void ShowTaskError(TaskQueueErrorEventArgs eventArgs)
        {
            var result = MessageBox
                         .Show($"Error while processing task {eventArgs.Task}.\nDetails: {eventArgs.ThrownException}\nRetry?", "Error", MessageBoxButton.YesNoCancel);

            switch (result)
            {
            case MessageBoxResult.Cancel:
                eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Abort;
                break;

            case MessageBoxResult.Yes:
                eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Retry;
                break;

            case MessageBoxResult.No:
                eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Skip;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 3
0
 private void _queue_TaskError(TaskQueueErrorEventArgs eventArgs)
 {
     StaticLogger.Log($"Error while processing file. {eventArgs.ThrownException}");
 }