public static string RenderSection(PartPackage partPack, SectionPackage[] sectionPacks) { ItemPackage inner_pack = MakeInner(partPack, sectionPacks); partPack["ItemTemplate"] = Properties.Resources.SingleContents; partPack["PartTemplate"] = Properties.Resources.StandardPart; return RenderPart(partPack, new ItemPackage[] { inner_pack }); }
public static string RenderSection(SectionPackage[] items, int depth) { string sectionName = DepthToSectionName(depth); PartPackage pack = new PartPackage(sectionName); pack["PartTemplate"] = Properties.Resources.SectionPart; pack["ItemTemplate"] = Properties.Resources.SectionItem; pack["Depth"] = depth.ToString(); pack["Indent"] = AddIndent(depth); return StandardPart.RenderPart(pack, items); }
private static ItemPackage MakeInner(PartPackage partPack, SectionPackage[] sectionPacks) { int depth = 0; if (partPack.ContainsKey("Depth")) { depth = int.Parse(partPack["Depth"]) + 1; } ItemPackage inner_pack = new ItemPackage(partPack["ClassIdentifier"]); inner_pack["Contents"] = SectionPart.RenderSection(sectionPacks, depth); return inner_pack; }