コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <summary>
 /// Start drag & drop operation on the currently selected html segment.
 /// </summary>
 /// <param name="control">the control to start the drag & drop on</param>
 private void StartDragDrop(Control control)
 {
     if (_dragDropData == null)
     {
         var html      = DomUtils.GenerateHtml(_root, HtmlGenerationStyle.Inline, true);
         var plainText = DomUtils.GetSelectedPlainText(_root);
         _dragDropData = HtmlClipboardUtils.GetDataObject(html, plainText);
     }
     control.DoDragDrop(_dragDropData, DragDropEffects.Copy);
 }
コード例 #3
0
ファイル: SelectionHandler.cs プロジェクト: radtek/AppModules
 /// <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);
         }
     }
 }