本文整理汇总了C#中ICSharpCode.WixBinding.WixDocument.GetRootDirectoryRef方法的典型用法代码示例。如果您正苦于以下问题:C# WixDocument.GetRootDirectoryRef方法的具体用法?C# WixDocument.GetRootDirectoryRef怎么用?C# WixDocument.GetRootDirectoryRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.WixBinding.WixDocument
的用法示例。
在下文中一共展示了WixDocument.GetRootDirectoryRef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindRootDirectory
/// <summary>
/// Tries to find a root directory or root directory ref in the specified
/// document.
/// </summary>
FindRootDirectoryResult FindRootDirectory(WixDocument currentDocument)
{
if (currentDocument.HasProduct) {
WixDirectoryElement rootDirectory = currentDocument.GetRootDirectory();
if (rootDirectory != null) {
view.AddDirectories(rootDirectory.GetDirectories());
}
document = currentDocument;
return FindRootDirectoryResult.RootDirectoryFound;
} else {
WixDirectoryRefElement rootDirectoryRef = currentDocument.GetRootDirectoryRef();
if (rootDirectoryRef != null) {
view.AddDirectories(rootDirectoryRef.GetDirectories());
document = currentDocument;
usingRootDirectoryRef = true;
return FindRootDirectoryResult.RootDirectoryRefFound;
}
}
return FindRootDirectoryResult.NoMatch;
}
示例2: UpdateOpenTextEditorWithRootDirectoryRefChanges
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);
}
示例3: SetUpFixture
public void SetUpFixture()
{
WixDocument doc = new WixDocument();
doc.LoadXml(GetWixXml());
directoryRef = doc.GetRootDirectoryRef();
}