1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- namespace InABox.Core
- {
- public class DFLayoutOptionFieldProperties : DFLayoutFieldProperties<string, string?>
- {
- public DFLayoutOptionFieldProperties()
- {
- Options = "";
- OptionType = DFLayoutOptionType.Combo;
- }
- [MemoEditor]
- [EditorSequence(1)]
- public string Options { get; set; }
- [EnumLookupEditor(typeof(DFLayoutOptionType))]
- [EditorSequence(2)]
- public DFLayoutOptionType OptionType { get; set; }
- protected override void LoadProperties()
- {
- base.LoadProperties();
- Options = GetProperty("Options", "");
- OptionType = GetProperty("OptionType", DFLayoutOptionType.Combo);
- }
- protected override void SaveProperties()
- {
- base.SaveProperties();
- SetProperty("Options", Options);
- SetProperty("OptionType", OptionType);
- }
- 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 ?? "";
- }
- }
- }
|