123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- namespace InABox.Core
- {
-
- public class DFLayoutStringFieldProperties : DFLayoutFieldProperties<string, string?>
- {
- [EditorSequence(3)]
- [CheckBoxEditor(Caption = "Allow Wrap?")]
- public bool TextWrapping { get; set; } = false;
- [EditorSequence(4)]
- [CheckBoxEditor(Caption = "Popup Editor?")]
- public bool PopupEditor { get; set; } = false;
- public override string? DeserializeValue(DFLoadStorageEntry entry)
- {
- return entry.GetValue<string>();
- }
- public override void SerializeValue(DFSaveStorageEntry entry, string? value)
- {
- entry.SetValue(value);
- }
- public override string GetValue(string? value)
- {
- return value ?? Default;
- }
- public override string FormatValue(string? value)
- {
- return value ?? "";
- }
- protected override void LoadProperties()
- {
- base.LoadProperties();
- PopupEditor = GetProperty(nameof(PopupEditor), false);
- TextWrapping = GetProperty(nameof(TextWrapping), false);
- }
- protected override void SaveProperties()
- {
- base.SaveProperties();
- SetProperty(nameof(PopupEditor), PopupEditor);
- SetProperty(nameof(TextWrapping), TextWrapping);
- }
- }
- }
|