public FluentStateTransitionBehaviour <TContext> RegisterTransition(string transitionName, string startState, params string[] endStates) { var trns = base.RegisterTransition(transitionName, startState, endStates); FluentStateTransitionBehaviour <TContext> behav = new FluentStateTransitionBehaviour <TContext>(); behav.Transition = trns; return(behav); }
/// <summary> /// performs the transition function "automatically", with arguments produced by the argument factory if there is one. /// If there is no factory, null args are used. /// </summary> /// <param name="context"></param> /// <returns></returns> public string PerformTriggeredTransition(TContext context, FluentStateTransitionBehaviour <TContext> behav) { if (this.TriggerArgumentFactory == null) { return(behav.PerformTransition(context)); } else { var args = this.TriggerArgumentFactory.Invoke(context); return(behav.PerformTransition(context, args)); } }