private void ParseForRichTextBlock(string plain) { Stopwatch sw = new Stopwatch(); sw.Start(); VKTextParser.SetText(plain, Result, OnLinkClicked); sw.Stop(); Paragraph p = new Paragraph(); p.Inlines.Add(new Run { Text = $"Parsing and rendering took {sw.ElapsedMilliseconds} ms.", FontSize = 12, FontStyle = Windows.UI.Text.FontStyle.Italic }); Result.Blocks.Add(p); }
private void ParseForString(string plain) { Stopwatch sw = new Stopwatch(); sw.Start(); string text = VKTextParser.GetParsedText(plain); sw.Stop(); Paragraph p = new Paragraph(); p.Inlines.Add(new LineBreak()); p.Inlines.Add(new LineBreak()); p.Inlines.Add(new Run { Text = text, FontSize = 14 }); p.Inlines.Add(new LineBreak()); p.Inlines.Add(new Run { Text = $"Parsing took {sw.ElapsedMilliseconds} ms.", FontSize = 12, FontStyle = Windows.UI.Text.FontStyle.Italic }); Result.Blocks.Add(p); }