DFLayoutMultiSignaturePadProperties.cs 913 B

123456789101112131415161718192021222324252627282930
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace InABox.Core
  6. {
  7. public class DFLayoutMultiSignaturePadProperties : DFLayoutFieldProperties<Dictionary<string, byte[]>, Dictionary<string, byte[]>?>
  8. {
  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. }