ShapeObject.DesignExt.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using FastReport.Forms;
  2. using System.Drawing.Drawing2D;
  3. using System.Drawing;
  4. using System;
  5. using System.Windows.Forms;
  6. namespace FastReport
  7. {
  8. partial class ShapeObject : IHasEditor
  9. {
  10. #region Public Methods
  11. /// <inheritdoc/>
  12. public bool InvokeEditor()
  13. {
  14. using (FillEditorForm editor = new FillEditorForm())
  15. {
  16. editor.Fill = Fill.Clone();
  17. if (editor.ShowDialog() == DialogResult.OK)
  18. {
  19. Fill = editor.Fill;
  20. return true;
  21. }
  22. return false;
  23. }
  24. }
  25. /// <inheritdoc/>
  26. public override void OnBeforeInsert(int flags)
  27. {
  28. shape = (ShapeKind)flags;
  29. }
  30. /// <inheritdoc/>
  31. public override int GetImageIndex()
  32. {
  33. switch (Shape)
  34. {
  35. case ShapeKind.Rectangle:
  36. return 108;
  37. case ShapeKind.RoundRectangle:
  38. return 109;
  39. case ShapeKind.Ellipse:
  40. return 110;
  41. case ShapeKind.Triangle:
  42. return 111;
  43. case ShapeKind.Diamond:
  44. return 131;
  45. }
  46. return base.GetImageIndex();
  47. }
  48. #endregion
  49. }
  50. }