Exemplo n.º 1
0
 //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
 #region --Constructors--
 /// <summary>
 /// Basic Constructor
 /// </summary>
 /// <history>
 /// 02/06/2018 Created [Fabian Sauter]
 /// </history>
 public Field()
 {
     options         = new List <FieldOption>();
     selectedOptions = new List <FieldOption>();
     value           = null;
     var             = null;
     label           = null;
     dfConfiguration = new DynamicFormsConfiguration();
 }
Exemplo n.º 2
0
        public Field(XmlNode node)
        {
            var   = node.Attributes["var"]?.Value;
            label = node.Attributes["label"]?.Value;

            switch (node.Attributes["type"]?.Value)
            {
            case "boolean":
                value = XMLUtils.tryParseToBool(getValue(node));
                type  = FieldType.BOOLEAN;
                break;

            case "text-private":
                value = getValue(node);
                type  = FieldType.TEXT_PRIVATE;
                break;

            case "text-single":
                value = getValue(node);
                type  = FieldType.TEXT_SINGLE;
                break;

            case "text-multi":
                type = FieldType.TEXT_MULTI;
                break;

            case "fixed":
                value = getValue(node);
                type  = FieldType.FIXED;
                break;

            case "list-single":
                options         = getOptions(node);
                selectedOptions = getSelectedOptions(node, options);
                type            = FieldType.LIST_SINGLE;
                break;

            case "list-multi":
                options         = getOptions(node);
                selectedOptions = getSelectedOptions(node, options);
                type            = FieldType.LIST_MULTI;
                break;

            case "hidden":
                value = getValue(node);
                type  = FieldType.HIDDEN;
                break;

            default:
                value = getValue(node);
                type  = FieldType.NONE;
                break;
            }
            dfConfiguration = new DynamicFormsConfiguration(node);
        }