public override TranslationState VisitImagePart(ImagePart part, TranslationState ctx) { ctx.Result = FuncListUtility.Cons( new ImageElement(part.Url, ctx.Rect), FuncListUtility.Empty <ScreenElement>()); return(ctx); }
public override TranslationState VisitTextPart(TextPart part, TranslationState ctx) { ctx.Result = FuncListUtility.Cons( new TextElement(part.Text, ctx.Rect), FuncListUtility.Empty <ScreenElement>()); return(ctx); }
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 = FuncListUtility.Cons(new TextElement(part.Text, titleRc), bodyElements); return(ctx); }