LabelEditor.cs 887 B

123456789101112131415161718192021222324252627282930
  1. using FastReport.Gauge;
  2. using System;
  3. using System.ComponentModel;
  4. using System.Drawing.Design;
  5. namespace FastReport.TypeEditors
  6. {
  7. internal class LabelEditor : UITypeEditor
  8. {
  9. public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
  10. {
  11. return UITypeEditorEditStyle.Modal;
  12. }
  13. public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value)
  14. {
  15. GaugeLabel label = (GaugeLabel)Value;
  16. GaugeObject gauge = label.Parent;
  17. GaugeEditorForm gaugeEditor = gauge.GetGaugeEditor;
  18. gaugeEditor.ActivePage = GaugeEditorPage.Label;
  19. if (gauge.InvokeEditor(gaugeEditor))
  20. {
  21. gauge.Report.Designer.SetModified(this, "Change");
  22. }
  23. return gauge.Label;
  24. }
  25. }
  26. }