Beispiel #1
0
        public static void RunAsync(ActionWithReturnAndArg[] actions, ActionWithArgs onDone, object argsToActions = null)
        {
            object[] resps       = new object[actions.Length];
            int      respsRemain = actions.Length;

            StartNew(delegate(EasyThread sender, object args) {
                for (int c = 0; c < actions.Length; c++)
                {
                    StartNew(delegate(EasyThread sender2, object args2)
                    {
                        object ret = actions[(int)args2](argsToActions);
                        respsRemain--;
                    }, false, c);
                }

                while (respsRemain > 0)
                {
                    sender.sleep(1);
                }

                onDone(resps);
            }, false);
        }
Beispiel #2
0
 public static void RunAsync(ActionWithReturn action, ActionWithArgs onDone)
 {
     RunAsync(new ActionWithReturn[] { action }, onDone);
 }
Beispiel #3
0
 public static void RunAsync(ActionWithReturnAndArg action, ActionWithArgs onDone, object argsToAction = null)
 {
     RunAsync(new ActionWithReturnAndArg[] { action }, onDone, argsToAction);
 }