DFLayoutSignaturePadProperties.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. [EditorSequence(-995)] [NullEditor] public override byte[] Default { get; set; } = new byte[] { };
  10. public override string FormatValue(byte[]? value)
  11. {
  12. return value != null ? "Yes" : "";
  13. }
  14. public override byte[] GetValue(byte[]? value)
  15. {
  16. return value ?? Array.Empty<byte>();
  17. }
  18. public override byte[]? DeserializeValue(DFLoadStorageEntry entry)
  19. {
  20. return entry.GetValue<byte[]>();
  21. }
  22. public override void SerializeValue(DFSaveStorageEntry entry, byte[]? value)
  23. {
  24. entry.SetValue(value);
  25. }
  26. }
  27. }