public static WorkflowRouter Build(IEnumerable <string> states_transition_pairs) { WorkflowRouter r = new WorkflowRouter(); string[] n = states_transition_pairs.ToArray(); for (int k = 0; k < n.Length; k += 2) { Entry e = new Entry() { State = n[k], Transition = n[k + 1] }; r.Table.Add(e); } return(r); }
public static WorkflowRouter Build(IEnumerable <string> states, IEnumerable <string> transitions) { WorkflowRouter r = new WorkflowRouter(); string[] s = states.ToArray(); string[] t = transitions.ToArray(); for (int k = 0; k < s.Length; ++k) { Entry e = new Entry() { State = s[k], Transition = t[k] }; r.Table.Add(e); } return(r); }