public async Task <PageRenderData> RenderPageAsync(RenderPageRequest request) { var context = new PageRenderData { Page = request.Page, Book = request.Book, Bookmarks = request.Bookmarks, PageSize = new Size( request.Panel.Width - AppSettings.Default.Margin.Left - AppSettings.Default.Margin.Right, request.Panel.Height - AppSettings.Default.Margin.Top - AppSettings.Default.Margin.Bottom), OffsetX = (int)AppSettings.Default.Margin.Left, OffsetY = (int)AppSettings.Default.Margin.Top, Panel = request.Panel, BackgroundBrush = AppSettings.Default.ColorScheme.BackgroundBrush, LinkBrush = AppSettings.Default.ColorScheme.LinkForegroundBrush.Color, Links = request.Links, Texts = request.Texts, }; await Task.Factory.StartNew(() => _contextBuilder.BuildContexts(context)); Draw(context); return(context); }
public async Task<PageRenderData> RenderPageAsync(RenderPageRequest request) { var context = new PageRenderData { Page = request.Page, Book = request.Book, Bookmarks = request.Bookmarks, PageSize = new Size( request.Panel.Width - AppSettings.Default.Margin.Left - AppSettings.Default.Margin.Right, request.Panel.Height - AppSettings.Default.Margin.Top - AppSettings.Default.Margin.Bottom), OffsetX = (int) AppSettings.Default.Margin.Left, OffsetY = (int) AppSettings.Default.Margin.Top, Panel = request.Panel, BackgroundBrush = AppSettings.Default.ColorScheme.BackgroundBrush, LinkBrush = AppSettings.Default.ColorScheme.LinkForegroundBrush.Color, Links = request.Links, Texts = request.Texts, }; await Task.Factory.StartNew(() => _contextBuilder.BuildContexts(context)); Draw(context); return context; }