void ProcessChild(CompileContext context, XmlNode node) { if (node.NodeType != XmlNodeType.Element) { return; } if (node.Prefix == StandardPrefixes.Variable) { throw new NotSupportedException("Variables not yet supported."); } else if (node.Prefix == StandardPrefixes.Value || node.Prefix == StandardPrefixes.Property) { if (node.Name == "Style") { styleLink = node["Style"].InnerText; } else { values.Add(node.LocalName, ParsingHelper.ParseValue(context, changeType, node)); } } else { if (type.GetInterface("SharpMedia.Graphics.GUI.Widgets.Containers.IContainer") == null) { throw new ParseException(string.Format("Only containers can have child widgets, " + "{0} is not a container.", name)); } Type resolveType = context.ResolveType(node.Prefix, node.LocalName); if (resolveType != null && resolveType.GetInterface("SharpMedia.Graphics.GUI.Widgets.IWidget") != null) { // We have a child element. ASTWidget widget = new ASTWidget(); children.Add(node.LocalName, widget); widget.Parse(context, node); } else { throw new ParseException("Only widgets are acceptable as children."); } } }
void ProcessAttribute(CompileContext context, XmlAttribute node) { values.Add(node.LocalName, ParsingHelper.ParseValue(context, changeType, node.LocalName, node.InnerText)); }