XmlElement AddProduct() { XmlElement productElement = CreateWixElement("Product"); DocumentElement.AppendChild(productElement); return(productElement); }
/// <summary> /// Adds a new root directory. /// </summary> public WixDirectoryElement AddRootDirectory() { // Add product element if it does not exist. XmlElement productElement = Product; if (productElement == null) { productElement = CreateWixElement("Product"); DocumentElement.AppendChild(productElement); } // Add root directory. WixDirectoryElement rootDirectory = WixDirectoryElement.CreateRootDirectory(this); return((WixDirectoryElement)productElement.AppendChild(rootDirectory)); }
void UpdateClass(WidgetParser parser, Stetic.Project stetic, ITypeDefinition widgetClass, ITypeDefinition wrapperClass) { string typeName = widgetClass.FullName; string basetypeName = GetBaseType(parser, widgetClass, stetic); XmlElement objectElem = (XmlElement)SelectSingleNode("objects/object[@type='" + typeName + "']"); if (objectElem == null) { // The widget class is not yet in the XML file. Create an element for it. objectElem = CreateElement("object"); objectElem.SetAttribute("type", typeName); string category = parser.GetCategory(widgetClass); if (category == String.Empty) { objectElem.SetAttribute("palette-category", "General"); } else { objectElem.SetAttribute("palette-category", category); } objectElem.SetAttribute("allow-children", "false"); if (wrapperClass != null) { objectElem.SetAttribute("wrapper", wrapperClass.FullName); } // By default add a reference to Gtk.Widget properties and events XmlElement itemGroups = objectElem.OwnerDocument.CreateElement("itemgroups"); objectElem.AppendChild(itemGroups); itemGroups = objectElem.OwnerDocument.CreateElement("signals"); objectElem.AppendChild(itemGroups); objectElem.SetAttribute("base-type", basetypeName); DocumentElement.AppendChild(objectElem); } UpdateObject(parser, basetypeName, objectElem, widgetClass, wrapperClass); }
public void SetProperty(string propName, string propValue) { var found = false; foreach (XmlElement propGrp in DocumentElement.ChildNodes) { if (propGrp.Name == "PropertyGroup" && !propGrp.HasAttribute("Condition")) { foreach (XmlElement prop in propGrp.ChildNodes) { if (prop.Name == propName) { prop.InnerText = propValue; found = true; } } } } if (!found) { var newProp = CreateElement(propName); newProp.InnerText = propValue; foreach (XmlElement propGrp in DocumentElement.ChildNodes) { if (propGrp.Name == "PropertyGroup" && !propGrp.HasAttribute("Condition")) { propGrp.AppendChild(newProp); found = true; } } if (!found) { var newGrp = CreateElement("PropertyGroup"); newGrp.AppendChild(newProp); DocumentElement.AppendChild(newGrp); } } }
private protected override void Initialize() { DocumentElement.AppendChild(Head = (Head)CreateElement(TagsNames.Head)); DocumentElement.AppendChild(Body = (HtmlBodyElement)CreateElement(TagsNames.Body)); }