コード例 #1
0
        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 });
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }