DFLayoutDocumentFieldProperties.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. namespace InABox.Core
  3. {
  4. public class DFLayoutDocumentFieldProperties : DFLayoutFieldProperties<Guid, Guid?>
  5. {
  6. public string? FileMask { get; set; }
  7. public override string FormatValue(Guid? value)
  8. {
  9. return value != null && value != Guid.Empty ? "Yes" : "";
  10. }
  11. public override Guid? DeserializeValue(DFLoadStorageEntry entry)
  12. {
  13. return entry.GetValue<Guid?>();
  14. }
  15. public override void SerializeValue(DFSaveStorageEntry entry, Guid? value)
  16. {
  17. entry.SetValue(value);
  18. }
  19. public override Guid GetValue(Guid? value)
  20. {
  21. return value ?? Default;
  22. }
  23. protected override void LoadProperties()
  24. {
  25. base.LoadProperties();
  26. FileMask = GetProperty("FileMask", FileMask);
  27. }
  28. protected override void SaveProperties()
  29. {
  30. base.SaveProperties();
  31. SetProperty("FileMask", FileMask);
  32. }
  33. }
  34. }