public static StateResult Retry() { var result = new StateResult(); result.ActionRequired = ActionRequiredEnum.Retry; return(result); }
public static StateResult MoveToThisState <T>() where T : IState { var result = new StateResult(); result.SetNextState <T>(); return(result); }
public static StateResult End() { var result = new StateResult(); result.ActionRequired = ActionRequiredEnum.EndSuccess; return(result); }
public static bool TryCreateMoveToThisState(string stateName, out StateResult stateResult) { Type?stateType = null; stateResult = null; try { stateType = Type.GetType(stateName); } catch (Exception) { } if (stateType == null) { return(false); } stateResult = new StateResult(); stateResult.ActionRequired = ActionRequiredEnum.TransitionToNewState; stateResult.nextState = stateType; return(true); }