Ejemplo n.º 1
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(RControl control)
 {
     if (_dragDropData == null)
     {
         var html      = DomUtils.GenerateHtml(_root, HtmlGenerationStyle.Inline, true);
         var plainText = DomUtils.GetSelectedPlainText(_root);
         _dragDropData = control.Adapter.GetClipboardDataObject(html, plainText);
     }
     control.DoDragDropCopy(_dragDropData);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 /// <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))
         {
             _root.HtmlContainer.Adapter.SetToClipboard(html, plainText);
         }
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Copy the currently selected html segment with style.<br/>
 /// </summary>
 public string GetSelectedHtml()
 {
     return(_root.HtmlContainer.IsSelectionEnabled ? DomUtils.GenerateHtml(_root, HtmlGenerationStyle.Inline, true) : null);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Get html from the current DOM tree with style if requested.
 /// </summary>
 /// <param name="styleGen">Optional: controls the way styles are generated when html is generated (default: <see cref="HtmlGenerationStyle.Inline"/>)</param>
 /// <returns>generated html</returns>
 public string GetHtml(HtmlGenerationStyle styleGen = HtmlGenerationStyle.Inline)
 {
     return(DomUtils.GenerateHtml(this._root, styleGen));
 }