/// <summary> /// Copy the currently selected html segment to clipboard.<br/> /// Copy rich html text and plain text. /// </summary> public void CopySelectedHtml() { var html = DomUtils.GenerateHtml(_root, HtmlGenerationStyle.Inline, true); var plainText = DomUtils.GetSelectedPlainText(_root); HtmlClipboardUtils.CopyToClipboard(html, plainText); }
/// <summary> /// Copy the currently selected html segment to clipboard.<br/> /// Copy rich html text and plain text. /// </summary> public void CopySelectedHtml() { if (_root.HtmlContainer.IsSelectionEnabled) { var html = DomUtils.GenerateHtml(_root, HtmlGenerationStyle.Inline, true); var plainText = DomUtils.GetSelectedPlainText(_root); if (!string.IsNullOrEmpty(plainText)) { HtmlClipboardUtils.CopyToClipboard(html, plainText); } } }