DFLayoutSignaturePadProperties.cs 947 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. namespace InABox.Core
  4. {
  5. // need to add a property to signaturefield (manager signature or something) that prevents a form being saved for later if the
  6. // manager signature is present - ensures that form is completed and submitted / cannot be changed
  7. public class DFLayoutSignaturePadProperties : DFLayoutFieldProperties<byte[], byte[]?>
  8. {
  9. public override string FormatValue(byte[]? value)
  10. {
  11. return value != null ? "Yes" : "";
  12. }
  13. public override byte[] GetValue(byte[]? value)
  14. {
  15. return value ?? Array.Empty<byte>();
  16. }
  17. public override byte[]? DeserializeValue(DFLoadStorageEntry entry)
  18. {
  19. return entry.GetValue<byte[]>();
  20. }
  21. public override void SerializeValue(DFSaveStorageEntry entry, byte[]? value)
  22. {
  23. entry.SetValue(value);
  24. }
  25. }
  26. }