Location FindProductElementEndLocation(ITextEditor textEditor, WixDocument document)
        {
            XmlElement        productElement = document.GetProduct();
            string            productId      = productElement.GetAttribute("Id");
            WixDocumentReader wixReader      = new WixDocumentReader(textEditor.Document.Text);

            return(wixReader.GetEndElementLocation("Product", productId));
        }
		public void Init()
		{
			doc = new WixDocument();
			doc.FileName = @"C:\Projects\Setup\Files.wxs";
			doc.LoadXml(GetWixXml());
			XmlElement productElement = doc.GetProduct();
			WixXmlAttributeCollection attributes = wixSchema.GetAttributes(productElement);
			productIdAttribute = attributes["Id"];
			productUpgradeCodeAttribute = attributes["UpgradeCode"];
			
			XmlElement componentElement = (XmlElement)doc.SelectSingleNode("//w:Component", new WixNamespaceManager(doc.NameTable));
			attributes = wixSchema.GetAttributes(componentElement);
			componentGuidAttribute = attributes["Guid"];
			componentKeyPathAttribute = attributes["KeyPath"];
			
			XmlElement fileElement = (XmlElement)doc.SelectSingleNode("//w:File", new WixNamespaceManager(doc.NameTable));
			attributes = wixSchema.GetAttributes(fileElement);
			fileSourceAttribute = attributes["Source"];
			fileSrcAttribute = attributes["src"];
		}
示例#3
0
		TextLocation FindProductElementEndLocation(ITextEditor textEditor, WixDocument document)
		{
			XmlElement productElement = document.GetProduct();
			string productId = productElement.GetAttribute("Id");
			WixDocumentReader wixReader = new WixDocumentReader(textEditor.Document.Text);
			return wixReader.GetEndElementLocation("Product", productId);
		}