Exemplo n.º 1
0
        static void PrintEntry(TableOfContents toc,
			       IDocumentConsumer doc,
			       int ent, int depth, int depthLimit)
        {
            if ((depthLimit >= 0) && (depth > depthLimit))
            return;

            doc.PushBlock(new Block() {
            Indent = depth
            });

            doc.PushFragment(new Fragment() {
            Attr = Fragment.Attributes.Heading,
            Text = toc.GetName(ent),
            Linkref = toc.GetLinkref(ent)
            });

            for (int i = toc.FirstChild(ent); i >= 0; i = toc.NextSibling(i))
            PrintEntry(toc, doc, i, depth + 1, depthLimit);
        }
Exemplo n.º 2
0
        public SectionIndex(AnchorIndex anchor, TableOfContents toc)
        {
            for (int i = 0; i < toc.Count; i++)
            {
            int word = anchor.FindAnchor(toc.GetLinkref(i));

            if (word >= 0)
            items.Add(new Item(toc.GetName(i), word));
            }

            items.Sort(cmpWord);
        }