/// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] AutolinkInline link) { var url = link.Url; if (link.IsEmail) { url = "mailto:" + url; } if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { url = "#"; } var hyperlink = new Hyperlink { Command = Commands.Hyperlink, CommandParameter = url, NavigateUri = new Uri(url, UriKind.RelativeOrAbsolute), ToolTip = link.Url, }; hyperlink.SetResourceReference(FrameworkContentElement.StyleProperty, Styles.HyperlinkStyleKey); renderer.Push(hyperlink); renderer.WriteText(link.Url); renderer.Pop(); }
/// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] LiteralInline obj) { if (obj.Content.IsEmpty) { return; } renderer.WriteText(ref obj.Content); }
/// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] LineBreakInline obj) { if (obj.IsHard) { renderer.WriteInline(new LineBreak()); } else { // Soft line break. renderer.WriteText(" "); } }
/// <inheritdoc/> protected override void Write(WpfRenderer renderer, DelimiterInline obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } renderer.WriteText(obj.ToLiteral()); renderer.WriteChildren(obj); }
protected override void Write(WpfRenderer renderer, HtmlEntityInline obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } var transcoded = obj.Transcoded; renderer.WriteText(ref transcoded); }
/// <inheritdoc/> protected override void Write(WpfRenderer renderer, LiteralInline obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (obj.Content.IsEmpty) { return; } renderer.WriteText(ref obj.Content); }
/// <inheritdoc/> protected override void Write(WpfRenderer renderer, LineBreakInline obj) { if (renderer == null) { throw new ArgumentNullException(nameof(renderer)); } if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (obj.IsHard) { renderer.WriteInline(new LineBreak()); } else { // Soft line break. renderer.WriteText(" "); } }
/// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] DelimiterInline obj) { renderer.WriteText(obj.ToLiteral()); renderer.WriteChildren(obj); }
protected override void Write([NotNull] WpfRenderer renderer, [NotNull] HtmlEntityInline obj) { var transcoded = obj.Transcoded; renderer.WriteText(ref transcoded); }