static string Generate(SolutionDom sln) { XElement body; var doc = GetDoc(out body); body.Add(x("h1", sln.Name)); XElement tbody; var table = Section( Names[Strings.Namespace + "_s"], x("table", a("class", "doc_table"), tbody = x("tbody")) ); tbody.Add(BuildRow(new XElement[0], x("span", Names[Strings.Name]), Names[Strings.Description].ToSpan(), "th")); foreach (var ns in sln.Namespaces) { tbody.Add(BuildRow( Enumerable.Empty <XElement>(), BuildNsUrl(ns.Name), XMLUtils.GetTagInnerXml(ns.DocInfo, "summary", Navigation, false) )); } body.Add(table); return(doc.ToString()); }
private void Browse_Click(object sender, RoutedEventArgs e) { var dlg = new VistaOpenFileDialog { Filter = "Assembly Files (*.dll)|*.dll", Multiselect = true, }; if (dlg.ShowDialog(this) != true) { return; } Toc.Items.Clear(); var navigation = new Navigation { UrlPrefix = "http://stocksharp.com/doc/ref/", EmptyImage = "http://stocksharp.com/images/blank.gif" }; GenerateHtml.CssUrl = @"file:///C:/VisualStudio/Web/trunk/Site/css/style.css"; GenerateHtml.Navigation = navigation; //ToDo: переделать GenerateHtml.IsHtmlAsDiv = false; GenerateHtml.IsRussian = true; var asmFiles = dlg.FileNames; var docFiles = asmFiles .Select(f => Path.Combine(Path.GetDirectoryName(f), Path.GetFileNameWithoutExtension(f) + ".xml")) .Where(File.Exists) .ToArray(); var slnDom = SolutionDom.Build("StockSharp. Описание типов", asmFiles, docFiles, Path.GetFullPath(@"..\..\..\..\..\StockSharp\trunk\Documentation\DocSandCastle\Comments\project.xml"), null, new FindOptions { InternalClasses = false, UndocumentedClasses = true, PrivateMembers = false, UndocumentedMembers = true }); _root = BuildPages.BuildSolution(slnDom); BuildTree(_root, Toc.Items); }
public static OfflineDynamicPage BuildSolution(SolutionDom solutionDom, bool onlyNamespaces = true) { var ret = new OfflineDynamicPage { RussianTitle = solutionDom.Name, RussianContent = GenerateHtml.Generate(solutionDom), }; if (onlyNamespaces) { AddNamespaces(ret, solutionDom.Namespaces); } else { foreach (var asm in solutionDom.Assemblies) { AddAssembly(ret, asm); } } return(ret); }