public static FormElement AttributeValueFromFormNode(XElement node) { var formElement = new FormElement(); var properties = formElement.GetType().GetProperties(); foreach (var property in properties) { var value = ExtractAttributeValueFromNode(property.Name, node); property.SetValue(formElement, value, null); } return formElement; }
public static XElement AddNodeToForm(Element param) { var node = new XElement("Form"); var formElement = new FormElement(param); var properties = formElement.GetType().GetProperties(); foreach (var property in properties) { var value = property.GetValue(formElement, null); if (value != null && !string.IsNullOrEmpty(value.ToString())) { AddAttributeInNode(property.Name, value.ToString(), node); } } return node; }
public IEnumerable <IElementValidator> GetValidators(FormElement element) { return(GetValidators(element.GetType())); }