public override VisualLineElement ConstructElement(int offset) { Match match = FindMatch(offset); if (!match.Success || match.Index != 0) { return(null); } return(new VisualLinkLineText(match.Value, CurrentContext.VisualLine, match.Length, (customlink) => LinkClick?.Invoke(this, customlink.Text))); }
/// <summary> /// A mouse button has been released, check if something has been clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PopupNotifierForm_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (RectClose.Contains(e.X, e.Y)) { CloseClick?.Invoke(this, EventArgs.Empty); } if (RectContentText.Contains(e.X, e.Y)) { LinkClick?.Invoke(this, EventArgs.Empty); } if (RectOptions.Contains(e.X, e.Y) && (Parent.OptionsMenu != null)) { ContextMenuOpened?.Invoke(this, EventArgs.Empty); Parent.OptionsMenu.Show(this, new Point(RectOptions.Right - Parent.OptionsMenu.Width, RectOptions.Bottom)); Parent.OptionsMenu.Closed += OptionsMenu_Closed; } } }
private void linkBtn_Click(object sender, RoutedEventArgs e) { LinkClick?.Invoke(sender, e); }
public void InvokeLinkClicked(string link) { LinkClick?.Invoke(link); }