示例#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));
        }
示例#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);
        }
示例#3
0
 public abstract IFormBuilder <T> Field(string name, PromptAttribute prompt, ActiveDelegate <T> active = null, ValidateAsyncDelegate <T> validate = null);
示例#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);
 }