private void InternalsTable(Dependency branch, Dictionary <Dependency, int> mapping, int section) { var set = new HashSet <string>(); foreach (var child in branch.Children) { foreach (var dep in this.assembled.Linkings[child].Interlinks) { var found = FindLinks.Get(child, dep, this.options["sep"]); if (found.Count == 0) { continue; } foreach (var link in FindLinks.Get(child, dep, this.options["sep"])) { set.Add(link.Value); } } } if (set.Count == 0) { return; } var list = set.ToList(); this.WriteLine(string.Format(this.SubsectionBegin, "Internals" + section, "Internals")); this.Listing(list, "Dependencies that cause the edges of the graph to be formed", "Internal Dependencies"); this.file.Write(this.SubsectionEnd); }
public static List <KeyValuePair <string, string> > Get(Dependency linkFrom, Dependency linkTo, string sep) { var walker = new FindLinks(linkTo, sep); walker.Visit(linkFrom); return(walker.Links); }
private void LinksTable(Dependency branch, Dictionary <Dependency, int> mapping, bool visibleHeader, int section) { if (!this.EdgeExists(branch)) { return; } this.WriteLine(string.Format(this.SubsectionBegin, "Links" + section, "Edge definitions")); this.Write(string.Format(this.TableBegin, string.Empty)); foreach (var child in branch.Children) { foreach (var dep in this.assembled.Linkings[child].Interlinks) { var first = child.Path(this.options["sep"]); if (mapping.Keys.Contains(child)) { first = string.Format(string.Format(this.Link, mapping[child], first)); } var second = dep.Path(this.options["sep"]); if (mapping.Keys.Contains(dep)) { second = string.Format(string.Format(this.Link, mapping[dep], second)); } if (visibleHeader) { this.Write(string.Format(this.ListItem, string.Empty)); } this.Write(this.TableHeadBegin); this.Write(string.Format(this.TableRowBegin, " id=\"main\"", " title=\"Dependencies that cause this edge of the graph to be formed\"")); this.file.Write(string.Format(this.TableHeadItem, string.Empty, string.Empty, first)); this.file.Write(string.Format(this.TableHeadItem, string.Empty, string.Empty, this.RightArrow)); this.file.Write(string.Format(this.TableHeadItem, string.Empty, string.Empty, second)); this.file.Write(this.TableRowEnd); this.Write(this.TableHeadEnd); if (visibleHeader) { this.TableHeadRowDiv(3); } this.Write(this.TableBodyBegin); var found = FindLinks.Get(child, dep, this.options["sep"]); if (found.Count == 0) { continue; } foreach (var link in FindLinks.Get(child, dep, this.options["sep"])) { this.Write(string.Format(this.TableRowBegin, string.Empty, string.Empty)); this.file.Write(string.Format(this.TableBodyItem, string.Empty, link.Key)); this.file.Write(string.Format(this.TableBodyItem, string.Empty, this.RightArrow)); this.file.Write(string.Format(this.TableBodyItem, string.Empty, link.Value)); this.file.Write(this.TableRowEnd); } this.Write(this.TableBodyEnd); } } this.Write(this.TableBodyEnd); this.Write(this.TableEnd); this.file.Write(this.SubsectionEnd); }