Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public abstract IFormBuilder <T> Field(string name, PromptAttribute prompt, ActiveDelegate <T> active = null, ValidateAsyncDelegate <T> validate = null);
Ejemplo n.º 4
0
 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);
 }