public DesignModelProperty(string name, IDataType type, object value, ISchemaElementAttribute definition = null, IParseLocationInfo parseLocation = null) { Name = name; Type = type; Value = value; ParseLocation = parseLocation; Definition = definition; }
/// <summary> /// Adds an attribute. /// </summary> /// <param name="attribute"></param> public void AddAttribute(ISchemaElementAttribute attribute) { if (_attributes.Any(x => x.Name == attribute.Name)) { throw new SchemaException($"Attribute '{attribute.Name}' is already defined for schema element '{Name}'."); } if (_attributes.Any(x => x.Name == attribute.Name)) { throw new SchemaException($"Attribute '{attribute.Name}' is already defined for schema element '{Name}'."); } _attributes.Add(attribute); }
private XElement CreateAttributeElement(ISchemaElementAttribute schemaElementAttribute) { var attributeXmlElement = new XElement(XsdNamespace + "attribute", new XAttribute("name", schemaElementAttribute.Name.LocalName), new XAttribute("type", schemaElementAttribute.Type.XsdName) ); if (schemaElementAttribute.IsMandatory) { attributeXmlElement.Add(new XAttribute("use", "required")); } this.AddDocumentationElement(attributeXmlElement, schemaElementAttribute.Description); return(attributeXmlElement); }
public XmlAttribute(ISchemaElementAttribute definition, string value, IParseLocationInfo parseLocation) { this.Definition = definition; this.Value = value; this.ParseLocation = parseLocation; }