public static ComponentProperty CreateFromProperty(Property property) { var newProperty = new ComponentPropertyImpl(property.Name) { ValidationOptions = new ValidationOptions(property.ValidationOptions), Type = property.Type }; return(newProperty); }
public ComponentProperty DeserialiseComponentProperty(XmlNode propertyNode, ComponentSpecification spec) { NodeProcessor proc = new NodeProcessor(propertyNode); ComponentProperty property = new ComponentPropertyImpl(); property.Specification = spec; property.Name = proc.GetString("Name"); property.Type = proc.GetString("Type"); if (proc.Exists("Validation")) { property.ValidationOptions = DeserialiseValidationOptions(propertyNode.SelectSingleNode("Validation")); } else { property.ValidationOptions = new ValidationOptions(); } ProcessScriptBase(property, propertyNode); return(property); }