public override IFormBuilder <T> Field(string name, PromptAttribute prompt, ActiveDelegate <T> active = null, ValidateAsyncDelegate <T> validate = null) { var field = new FieldReflector <T>(name, _ignoreAnnotations); field.SetActive(active); field.SetValidate(validate); field.SetPrompt(prompt); return(Field(field)); }
public virtual IFormBuilder <T> Confirm(PromptAttribute prompt, ActiveDelegate <T> condition = null, IEnumerable <string> dependencies = null) { if (condition == null) { condition = state => true; } dependencies = dependencies ?? _form.Dependencies(_form.Steps.Count()); var confirmation = new Confirmation <T>(prompt, condition, dependencies, _form); confirmation.Form = _form; _form._fields.Add(confirmation); _form._steps.Add(new ConfirmStep <T>(confirmation)); return(this); }
public abstract IFormBuilder <T> Field(string name, PromptAttribute prompt, ActiveDelegate <T> active = null, ValidateAsyncDelegate <T> validate = null);
public virtual IFormBuilder <T> Message(PromptAttribute prompt, ActiveDelegate <T> condition = null, IEnumerable <string> dependencies = null) { _form._steps.Add(new MessageStep <T>(prompt, condition, dependencies, _form)); return(this); }