public void SetUpFixture()
		{
			WixDocument doc = new WixDocument();
			doc.LoadXml(GetWixXml());
			dialogElement = (WixDialogElement)doc.SelectSingleNode("//w:Dialog", new WixNamespaceManager(doc.NameTable));
			dialogElement.SetAttribute("Id", "id");
			dialogElement.SetAttribute("Title", "title");
			XmlElement controlElement = doc.CreateElement("Control", WixNamespaceManager.Namespace);
			dialogElement.AppendChild(controlElement);
		}
Exemple #2
0
        /// <summary>
        /// Merges the changes made to the wix document by overwriting the dialog element.
        /// </summary>
        void IWixDialogDesignerGenerator.MergeFormChanges(string dialogId, XmlElement dialogElement)
        {
            DomRegion region = GetTextEditorRegionForDialogElement(dialogId);

            if (region.IsEmpty)
            {
                ThrowDialogElementCouldNotBeFoundError(dialogId);
            }

            WixTextWriter    writer           = new WixTextWriter(textEditor.Options);
            WixDialogElement wixDialogElement = (WixDialogElement)dialogElement;
            string           newDialogXml     = wixDialogElement.GetXml(writer);

            WixDocumentEditor editor = new WixDocumentEditor(textEditor);

            editor.Replace(region, newDialogXml);
        }