本文整理汇总了C#中HtmlTable.AddCodeLine方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTable.AddCodeLine方法的具体用法?C# HtmlTable.AddCodeLine怎么用?C# HtmlTable.AddCodeLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlTable
的用法示例。
在下文中一共展示了HtmlTable.AddCodeLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EncodeRowGroups
private IEnumerable<string> EncodeRowGroups(List<HtmlTableRowGroup> rowGroups, string baseHeader, string diffHeader, string leftIdPrefix, string rightIdPrefix, string edgePrefix)
{
var left = new HtmlTable(leftIdPrefix, leftIdPrefix, "LeftTable");
var right = new HtmlTable(rightIdPrefix, rightIdPrefix, "RightTable");
var edge = new HtmlTable(edgePrefix, edgePrefix, "EdgeTable");
left.AddDiffHeader();
right.AddDiffHeader();
foreach (var rowGroup in rowGroups)
{
left.AddBody(rowGroup.Class + " Base");
right.AddBody(rowGroup.Class + " Diff");
edge.AddBody(rowGroup.Class + " Diff");
foreach (var line in rowGroup.Lines)
{
var id = line.Left.Id + "-" + line.Right.Id;
left.AddCodeLine(line.Left.LineNumber, id, line.Left.Code);
right.AddCodeLine(line.Right.LineNumber, id, line.Right.Code);
edge.AddEdgeLine(line.Right.LineNumber, id);
}
left.EndBody();
right.EndBody();
edge.EndBody();
// Add Seperator line after every unchanged
if (rowGroup.DiffType == DiffType.Unchanged)
AddSeperators(rowGroup, left, right, edge);
}
left.End();
right.End();
edge.End();
var testMode = false;
var containerTable = new HtmlTable("", "DiffView", "DiffTable", testMode);
containerTable.AddContainerHeader("ContainerTable", baseHeader, diffHeader);
containerTable.AddTables(left, right, edge);
containerTable.End(testMode);
return containerTable.Html;
}