Pend() public static method

public static Pend ( System.Action evt ) : void
evt System.Action
return void
Beispiel #1
0
 internal void PendError(string reason)
 {
     foreach (var errorCallback in ErrorCallbacks)
     {
         var callback = errorCallback;
         EventLoop.Pend(() => callback(reason));
     }
 }
Beispiel #2
0
 internal void PendThen(object result)
 {
     foreach (var thenCallback in ThenCallbacks)
     {
         var callback = thenCallback;
         EventLoop.Pend(() => callback(result));
     }
 }
Beispiel #3
0
Datei: Do.cs Projekt: benlesh/ALE
 public static void Async <TReturn>(Func <TReturn> operation, Action <Exception, TReturn> callback)
 {
     EventLoop.Pend(() =>
     {
         try
         {
             var result = operation();
             callback(null, result);
         } catch (Exception ex)
         {
             EventLoop.Pend(() => callback(ex, default(TReturn)));
             throw;
         }
     });
 }
Beispiel #4
0
Datei: Do.cs Projekt: benlesh/ALE
 public static void Async(Action operation, Action <Exception> callback = null)
 {
     EventLoop.Pend(() =>
     {
         try
         {
             operation();
             if (callback != null)
             {
                 EventLoop.Pend(() => callback(null));
             }
         } catch (Exception ex)
         {
             if (callback != null)
             {
                 EventLoop.Pend(() => callback(ex));
             }
         }
     });
 }