public override TranslationState VisitTitledPart(TitledPart part, TranslationState ctx)
        {
            var rc           = new RectangleF(ctx.Rect.Left, ctx.Rect.Top + 35.0f, ctx.Rect.Width, ctx.Rect.Height - 35.0f);
            var bodyElements = part.Body.Accept(this, new TranslationState {
                Rect = rc
            }).Result;
            var titleRc = new RectangleF(ctx.Rect.Left, ctx.Rect.Top, ctx.Rect.Width, 35.0f);

            ctx.Result = FuncListExtensions.Cons(new TextElement(part.Text, titleRc), bodyElements);
            return(ctx);
        }
Beispiel #2
0
 public override int VisitTitledPart(TitledPart part, int state)
 {
     // Recursively count words of the body
     return(part.Text.Text.Split(' ').Length + part.Body.Accept(this, state));
 }