WhenStageAllowed <TWf>(this IFluentConfigurator <IWorkflowConditionalObject <TWf> > c, Func <TWf, Workflow <TWf> .Stage> getStage) where TWf : class, IWorkflow <TWf> { var cond = new WorkflowCondition <TWf>(w => getStage(w).Check(w) == WorkflowConditionResult.Passed ? WorkflowConditionResult.Passed : WorkflowConditionResult.Failed); cond.SetMessage(w => getStage(w).GetMessages(w)); cond.SetHighlights(w => getStage(w).GetHighlights(w)); c?.Target.AddCondition(cond); return(c); }
public void SetNext(WorkflowCondition <T> next) => _next = next;
void IWorkflowConditionalObject <T> .AddCondition(WorkflowCondition <T> condition) { condition.SetNext(Condition); Condition = condition; }