DFLayoutMultiSignaturePadProperties.cs 1023 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections.Generic;
  2. namespace InABox.Core
  3. {
  4. public class DFLayoutMultiSignaturePadProperties : DFLayoutFieldProperties<Dictionary<string, byte[]>, Dictionary<string, byte[]>?>
  5. {
  6. [EditorSequence(-995)]
  7. [NullEditor]
  8. public override Dictionary<string, byte[]> Default { get; set; } = new Dictionary<string, byte[]>();
  9. public override string FormatValue(Dictionary<string, byte[]>? value)
  10. {
  11. return value != null ? "Yes" : "";
  12. }
  13. public override Dictionary<string, byte[]>? DeserializeValue(DFLoadStorageEntry entry)
  14. {
  15. return entry.GetValue<Dictionary<string, byte[]>>();
  16. }
  17. public override void SerializeValue(DFSaveStorageEntry entry, Dictionary<string, byte[]>? value)
  18. {
  19. entry.SetValue(value);
  20. }
  21. public override Dictionary<string, byte[]> GetValue(Dictionary<string, byte[]>? value)
  22. {
  23. return value ?? Default;
  24. }
  25. }
  26. }