void UpdateOpenTextEditorWithRootDirectoryRefChanges(ITextEditor textEditor, WixDocument document)
        {
            WixDirectoryRefElement rootDirectoryRef = document.GetRootDirectoryRef();
            string xml = rootDirectoryRef.GetXml(wixTextWriter);

            WixDocumentEditor documentEditor = new WixDocumentEditor(textEditor);

            documentEditor.ReplaceElement(rootDirectoryRef.Id, WixDirectoryRefElement.DirectoryRefElementName, xml);
        }
		public void Init()
		{
			textEditor = new MockTextEditor();
			textEditor.Document.Text = GetWixXml();
			
			string replacementXml = 
				"<NewElement>\r\n" +
				"</NewElement>";
			
			wixDocumentEditor = new WixDocumentEditor(textEditor);
			replacementRegion = wixDocumentEditor.ReplaceElement("TARGETDIR", "Directory", replacementXml);
		}
        void UpdateOpenTextEditorWithRootDirectoryChanges(ITextEditor textEditor, WixDocument document)
        {
            WixDirectoryElement rootDirectory = document.GetRootDirectory();
            string xml = rootDirectory.GetXml(wixTextWriter);

            WixDocumentEditor documentEditor = new WixDocumentEditor(textEditor);
            DomRegion         region         = documentEditor.ReplaceElement(rootDirectory.Id, WixDirectoryElement.DirectoryElementName, xml);

            if (!region.IsEmpty)
            {
                return;
            }

            Location location = FindProductElementEndLocation(textEditor, document);

            if (!location.IsEmpty)
            {
                documentEditor.InsertIndented(location, String.Concat(xml, "\r\n"));
            }
        }
Beispiel #4
0
		void UpdateOpenTextEditorWithRootDirectoryRefChanges(ITextEditor textEditor, WixDocument document)
		{
			WixDirectoryRefElement rootDirectoryRef = document.GetRootDirectoryRef();
			string xml = rootDirectoryRef.GetXml(wixTextWriter);
			
			WixDocumentEditor documentEditor = new WixDocumentEditor(textEditor);
			documentEditor.ReplaceElement(rootDirectoryRef.Id, WixDirectoryRefElement.DirectoryRefElementName, xml);
		}
Beispiel #5
0
		void UpdateOpenTextEditorWithRootDirectoryChanges(ITextEditor textEditor, WixDocument document)
		{
			WixDirectoryElement rootDirectory = document.GetRootDirectory();
			string xml = rootDirectory.GetXml(wixTextWriter);
			
			WixDocumentEditor documentEditor = new WixDocumentEditor(textEditor);
			DomRegion region = documentEditor.ReplaceElement(rootDirectory.Id, WixDirectoryElement.DirectoryElementName, xml);
			if (!region.IsEmpty) {
				return;
			}
			
			TextLocation location = FindProductElementEndLocation(textEditor, document);
			if (!location.IsEmpty) {
				documentEditor.InsertIndented(location, String.Concat(xml, "\r\n"));
			}
		}