SVGObject.DesignExt.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using FastReport.Forms;
  2. using FastReport.Utils;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. #pragma warning disable
  6. namespace FastReport.SVG
  7. {
  8. public partial class SVGObject : IHasEditor
  9. {
  10. #region Public Methods
  11. /// <inheritdoc/>
  12. public override ContextMenuBase GetContextMenu()
  13. {
  14. return new SVGObjectMenu(Report.Designer);
  15. }
  16. /// <inheritdoc/>
  17. public override void HandleDragDrop(FRMouseEventArgs e)
  18. {
  19. DataColumn = (e.DragSource as SVGObject).DataColumn;
  20. dragAccept = false;
  21. }
  22. /// <inheritdoc/>
  23. public override void HandleDragOver(FRMouseEventArgs e)
  24. {
  25. if (PointInObject(new PointF(e.x, e.y)) && e.DragSource is SVGObject)
  26. e.handled = true;
  27. dragAccept = e.handled;
  28. }
  29. /// <summary>
  30. /// Invokes the object's editor.
  31. /// </summary>
  32. /// <returns><b>true</b> if object was edited succesfully.</returns>
  33. public override bool InvokeEditor()
  34. {
  35. using (SVGEditorForm form = new SVGEditorForm(this))
  36. {
  37. bool isOk = form.ShowDialog() == DialogResult.OK;
  38. Assign(form.SvgObject);
  39. return isOk ? true : false;
  40. }
  41. }
  42. #endregion Public Methods
  43. }
  44. }
  45. #pragma warning restore