1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Windows.Forms;
- namespace FastReport.Gauge
- {
- public partial class GaugeObject : IHasEditor
- {
- /// <inheritdoc/>
- public override void OnBeforeInsert(int flags)
- {
- base.OnBeforeInsert(flags);
- // to avoid applying last formatting
- Border.Lines = BorderLines.All;
- }
- /// <inheritdoc/>
- public bool InvokeEditor()
- {
- return InvokeEditor(GetGaugeEditor);
- }
- internal virtual GaugeEditorForm GetGaugeEditor => throw new NotImplementedException();
- internal virtual bool InvokeEditor(GaugeEditorForm gaugeEditor)
- {
- var oldGauge = Clone();
- using (gaugeEditor)
- {
- if (gaugeEditor.ShowDialog() != DialogResult.OK)
- {
- this.Assign(oldGauge);
- return false;
- }
- }
- return true;
- }
- }
- }
|