SimpleGauge.DesignExt.cs 762 B

123456789101112131415161718192021222324252627
  1. using System.Windows.Forms;
  2. namespace FastReport.Gauge.Simple
  3. {
  4. public partial class SimpleGauge : IHasEditor
  5. {
  6. /// <inheritdoc/>
  7. public override void OnBeforeInsert(int flags)
  8. {
  9. base.OnBeforeInsert(flags);
  10. // to avoid applying last formatting
  11. Border.Lines = BorderLines.All;
  12. }
  13. /// <inheritdoc />
  14. bool IHasEditor.InvokeEditor()
  15. {
  16. GaugeObject oldGauge = (GaugeObject)Clone();
  17. using (SimpleGaugeEditorForm gaugeEditor = new SimpleGaugeEditorForm(this))
  18. {
  19. if (gaugeEditor.ShowDialog() != DialogResult.OK)
  20. this.Scale = oldGauge.Scale;
  21. }
  22. return true;
  23. }
  24. }
  25. }