/// <summary> /// Tries to find a root directory or root directory ref in the specified /// document. /// </summary> FindRootDirectoryResult FindRootDirectory(WixDocument currentDocument) { if (currentDocument.IsProductDocument) { WixDirectoryElement rootDirectory = currentDocument.RootDirectory; if (rootDirectory != null) { view.AddDirectories(rootDirectory.GetDirectories()); } document = currentDocument; return(FindRootDirectoryResult.RootDirectoryFound); } else { WixDirectoryRefElement rootDirectoryRef = currentDocument.RootDirectoryRef; if (rootDirectoryRef != null) { view.AddDirectories(rootDirectoryRef.GetDirectories()); document = currentDocument; usingRootDirectoryRef = true; return(FindRootDirectoryResult.RootDirectoryRefFound); } } return(FindRootDirectoryResult.NoMatch); }
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); }
bool UpdateOpenFileWithRootDirectoryRefChanges(WixDocument wixDocument, TextAreaControl textAreaControl) { // Get the xml for the root directory ref. WixDirectoryRefElement rootDirectoryRef = wixDocument.RootDirectoryRef; string xml = GetWixXml(rootDirectoryRef); // Find the root directory ref location. return(ReplaceElement(rootDirectoryRef.Id, WixDirectoryRefElement.DirectoryRefElementName, textAreaControl, xml)); }
public void SetUpFixture() { WixDocument doc = new WixDocument(); doc.LoadXml(GetWixXml()); directoryRef = doc.GetRootDirectoryRef(); }