DFLayoutStringFieldProperties.cs 904 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace InABox.Core
  2. {
  3. public class DFLayoutStringFieldProperties : DFLayoutFieldProperties<string>
  4. {
  5. [CheckBoxEditor(Caption = "Popup Editor?")]
  6. public bool PopupEditor { get; set; }
  7. protected override void Init()
  8. {
  9. base.Init();
  10. PopupEditor = false;
  11. }
  12. public override object? ParseValue(object? value)
  13. {
  14. return value?.ToString();
  15. }
  16. public override string FormatValue(object? value)
  17. {
  18. return value?.ToString() ?? "";
  19. }
  20. protected override void LoadProperties()
  21. {
  22. base.LoadProperties();
  23. PopupEditor = GetProperty("PopupEditor", false);
  24. }
  25. protected override void SaveProperties()
  26. {
  27. base.SaveProperties();
  28. SetProperty("PopupEditor", PopupEditor);
  29. }
  30. }
  31. }