Exemplo n.º 1
0
 private static void DoTransferUntilSuccess(AccountBase from, long amount)
 {
     while (true)
     {
         long expectedAmount = from.GetBalance() + amount;
         try
         {
             from.Transfer(amount);
             break;
         }
         catch (NetworkTransferException)
         {
             if (from.GetBalance() == expectedAmount)
             {
                 break;
             }
         }
     }
     return;
 }