예제 #1
0
 private void HandleException(SmartCardReadOperation operation, Exception exception)
 {
     ExceptionPolicy.HandleException(ContainerBootstrapper.Container, exception);
     OnCompleted(new DriverCardCompletedEventArgs
     {
         Exception = exception,
         Operation = operation
     });
 }
예제 #2
0
 private void SafelyWithRetry(SmartCardReadOperation operation, Action action)
 {
     try
     {
         Task.Factory.StartNew(() =>
         {
             var resilient = new Resilient(OnProgress);
             resilient.ExecuteWithRetry(action);
         })
         .ContinueWith(t =>
         {
             if (t.IsFaulted)
             {
                 HandleException(operation, t.Exception);
             }
         });
     }
     catch (Exception ex)
     {
         HandleException(operation, ex);
     }
 }