LinearGauge.DesignExt.cs 785 B

123456789101112131415161718192021222324252627
  1. using System.Windows.Forms;
  2. namespace FastReport.Gauge.Linear
  3. {
  4. public partial class LinearGauge : 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. public override bool InvokeEditor()
  15. {
  16. GaugeObject oldGauge = (GaugeObject)Clone();
  17. using (LinearGaugeEditorForm gaugeEditor = new LinearGaugeEditorForm(this))
  18. {
  19. if (gaugeEditor.ShowDialog() != DialogResult.OK)
  20. Inverted = (oldGauge as LinearGauge).Inverted;
  21. }
  22. return true;
  23. }
  24. }
  25. }