Ejemplo n.º 1
0
        public void Replay(IDocumentConsumer con)
        {
            int f = 0;

            for (int b = 0; b < blocks.Count; b++)
            {
            while (f < blocks[b].FragmentIndex)
            con.PushFragment(fragments[f++]);

            con.PushBlock(blocks[b].Content);
            }

            while (f < fragments.Count)
            con.PushFragment(fragments[f++]);

            con.Close();
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static void PrintToc(TableOfContents toc,
				    IDocumentConsumer doc,
				    int depthLimit = -1)
        {
            doc.PushBlock(new Block());
            doc.PushFragment(new Fragment() {
            Attr = Fragment.Attributes.Heading,
            Text = toc.Title
            });

            for (int i = toc.FirstRoot(); i >= 0; i = toc.NextSibling(i))
            PrintEntry(toc, doc, i, 0, depthLimit);

            doc.Close();
        }
Ejemplo n.º 4
0
        public void ProduceBook(IDocumentConsumer con)
        {
            for (int i = 0; i < Spine.Count; i++)
            {
            OPFManifest.Item item = Manifest.GetById(Spine[i]);
            IDocumentConsumer filter =
            new NamespaceAnchors(item.Linkref + "#", con);

            con.PushFragment(new Fragment() {
            Attr = Fragment.Attributes.AnchorName,
            Text = item.Linkref
            });

            ProduceDocument(item.Linkref, filter);
            }
        }