private void FixLinks(MarkdownDocument document) { foreach (var item in document.Descendants().OfType <LinkInline>()) { LinkInline link = (LinkInline)item; if (item.IsImage) { ImageEventArgs args = new ImageEventArgs(link.Url, link.Url, link.Label, link.Label); ImageParsed?.Invoke(this, args); link.Url = args.Src; } else { LinkEventArgs args = new LinkEventArgs(link.Url, link.Url, link.Label, ""); LinkParsed?.Invoke(this, args); link.Url = args.Href; } } }
protected virtual PageView OnLinkParsed(string arg1, string arg2) { return(LinkParsed?.Invoke(arg1, arg2)); }