Esempio n. 1
0
        void Callback(string name, object err = null, object res = null)
        {
            if (IsDone)
            {
                return;
            }

            if (err != null)
            {
                taskRoutine.Cancel();
                Action <object, Dictionary <string, object> > action = finalFunc.action1;
                Cleanup();
                IsDone = true;
                IsFree = true;
                action(err, null);
                return;
            }

            result [name] = res;
            completeNum++;

            if (completeNum == total)
            {
                Action <object, Dictionary <string, object> > action = finalFunc.action1;
                Cleanup();
                IsDone = true;
                action(err, null);
            }
            else
            {
                RunOneFunc(funcs [completeNum] as ChildFunc);
            }
        }
Esempio n. 2
0
        void Callback(object err)
        {
            if (IsDone)
            {
                return;
            }

            if (err != null)
            {
                taskRoutine.Cancel();
                Action <object> action = finalFunc.action2;
                Cleanup();
                IsDone = true;
                IsFree = true;
                action(err);
                return;
            }

            completeNum++;

            if (completeNum == total)
            {
                Action <object> action = finalFunc.action2;
                Cleanup();
                IsDone = true;
                action(err);
            }
            else
            {
                RunOneFunc();
            }
        }