Exemplo n.º 1
0
 /// <summary>
 /// Creates a form item with these components.
 /// </summary>
 /// <param name="content">Do not pass null.</param>
 /// <param name="setup"></param>
 /// <param name="label">The form-item label.</param>
 /// <param name="validation"></param>
 public static FormItem ToFormItem(
     this IReadOnlyCollection <FlowComponent> content, FormItemSetup setup = null, IReadOnlyCollection <PhrasingComponent> label = null,
     EwfValidation validation = null)
 {
     label = label ?? Enumerable.Empty <PhrasingComponent>().Materialize();
     return(new FormItem(setup, label, content, validation != null ? validation.ToCollection() : Enumerable.Empty <EwfValidation>().Materialize()));
 }
Exemplo n.º 2
0
 internal FormItem(
     FormItemSetup setup, IReadOnlyCollection <PhrasingComponent> label, IReadOnlyCollection <FlowComponent> content, EwfValidation validation)
 {
     Setup          = setup ?? new FormItemSetup();
     this.label     = label;
     this.content   = content;
     Validation     = validation;
     ErrorSourceSet = validation != null ? new ErrorSourceSet(validations: validation.ToCollection()) : null;
 }