Example #1
0
 internal void AddAll(A?action, DFlowAction method)
 {
     foreach (var state in actions.Keys)
     {
         if (!actions[state].ContainsKey(action))
         {
             actions[state].Add(action, new List <ActionHolder>());
         }
         actions[state][action].Add(new ActionHolder(__id++, method));
         actions[state][action].Sort((a, b) => b.Id - a.Id);
     }
 }
Example #2
0
 internal void AddExcept(S?state, Type throwable, DFlowAction method = null, DFlowExceptionAction eMethod = null)
 {
     if (state == null)
     {
         AddAllExcept(throwable, method, eMethod);
         return;
     }
     if (method != null)
     {
         exceptions[state].Add(new ExceptionHolder(throwable, method));
     }
     if (eMethod != null)
     {
         exceptions[state].Add(new ExceptionHolder(throwable, eMethod));
     }
 }
Example #3
0
        internal void AddAllExcept(Type throwable, DFlowAction method = null, DFlowExceptionAction eMethod = null)
        {
            var h  = method != null ? new ExceptionHolder(throwable, method) : null;
            var eh = eMethod != null ? new ExceptionHolder(throwable, eMethod) : null;

            foreach (var list in exceptions.Values)
            {
                if (h != null)
                {
                    list.Add(h);
                }
                if (eh != null)
                {
                    list.Add(eh);
                }
            }
        }
Example #4
0
 internal void Add(S?state, A?action, DFlowAction method)
 {
     if (state == null)
     {
         AddAll(action, method);
         return;
     }
     if (!actions.ContainsKey(state))
     {
         actions.Add(state, new NullableDict <A?, List <ActionHolder> >());
     }
     if (!actions[state].ContainsKey(action))
     {
         actions[state].Add(action, new List <ActionHolder>());
     }
     actions[state][action].Add(new ActionHolder(__id++, method));
     actions[state][action].Sort((a, b) => b.Id - a.Id);
 }
Example #5
0
 public ExceptionHolder(Type throwable, DFlowAction action)
 {
     Action    = action;
     Throwable = throwable;
     EAction   = null;
 }
Example #6
0
 public ActionHolder(int id, DFlowAction method)
 {
     Id     = id;
     Method = method;
 }