private static string FindManualFolder(ManualPath manualPath) { var a = Assembly.GetExecutingAssembly(); var appDir = Path.GetDirectoryName(a.CodeBase.Replace(@"file:///", "")); Assert.IsNotNull(appDir); appDir += "\\" + manualPath; var candidates = new[] { appDir, Path.GetFullPath(Path.Combine(appDir, @"..")), Path.GetFullPath(Path.Combine(appDir, @"..\..")), Path.GetFullPath(Path.Combine(appDir, @"..\..\..")), Path.GetFullPath(Path.Combine(appDir, @"..\..\..\..")), Path.GetFullPath(Path.Combine(appDir, @"..\..\..\..\..")), Path.GetFullPath(Path.Combine(appDir, @"..\..\..\..\..\..")), Path.GetFullPath(Path.Combine(appDir, @"..\..\..\..\..\..\..")), "" }; foreach (var dir in candidates) { if (Directory.Exists(dir) && Directory.GetFiles(dir, "*.chm").Length > 0) { return(dir); } } throw new IOException("Could not find user guide folder"); }
private void TestSingleHelpFile(string filename, string folder, ManualPath filter) { var helpPath = folder; foreach (HelpTopic topic in Enum.GetValues(typeof(HelpTopic))) { var sourceFile = StringValueAttribute.GetValue(topic); if (filter == ManualPath.PdfCreatorManual && sourceFile.Contains("server")) { continue; } sourceFile = Path.Combine(helpPath, sourceFile + ".html"); Assert.IsTrue(File.Exists(sourceFile), $"Help file '{sourceFile}' does not exist in {filename}!"); } }