コード例 #1
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);
        }
		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);
		}
コード例 #3
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;
            }

            Location location = FindProductElementEndLocation(textEditor, document);

            if (!location.IsEmpty)
            {
                documentEditor.InsertIndented(location, String.Concat(xml, "\r\n"));
            }
        }
コード例 #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);
		}
コード例 #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"));
			}
		}