예제 #1
0
 public static void WaitIfLocked(this IOException ex, int ms)
 {
     if (ex.IsLocked())
     {
         if (ms > 0)
         {
             System.Threading.Thread.Sleep(ms);
         }
     }
     else
     {
         throw ex;
     }
 }
예제 #2
0
 /// <summary>
 /// Wait current thread for N milliseconds if exception is about Locking
 /// </summary>
 public static void WaitIfLocked(this IOException ex, int timerInMilliseconds)
 {
     if (ex.IsLocked())
     {
         if (timerInMilliseconds > 0)
         {
             System.Threading.Tasks.Task.Delay(timerInMilliseconds).Wait();
         }
     }
     else
     {
         throw ex;
     }
 }
예제 #3
0
 public static void WaitIfLocked(this IOException ex, int timer)
 {
     if (ex.IsLocked())
     {
         if (timer > 0)
         {
             WaitFor(timer);
         }
     }
     else
     {
         throw ex;
     }
 }