DFLayoutAddTaskFieldProperties.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Comal.Classes;
  2. using InABox.Clients;
  3. using InABox.Core;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. namespace PRSClasses
  9. {
  10. public class DFLayoutAddTaskFieldProperties : DFLayoutFieldProperties<int?>
  11. {
  12. public KanbanTypeLink TaskType { get; set; }
  13. public DFLayoutAddTaskFieldProperties()
  14. {
  15. TaskType = new KanbanTypeLink();
  16. }
  17. protected override void LoadProperties()
  18. {
  19. base.LoadProperties();
  20. TaskType.ID = GetProperty("TaskType", Guid.Empty);
  21. }
  22. protected override void SaveProperties()
  23. {
  24. base.SaveProperties();
  25. SetProperty("TaskType", TaskType.ID);
  26. }
  27. public override string FormatValue(object value)
  28. {
  29. return string.Format("{0}", value);
  30. }
  31. public override object? ParseValue(object value)
  32. {
  33. if (value is int)
  34. return value;
  35. if (int.TryParse(value as string, out var result))
  36. return result;
  37. return null;
  38. }
  39. }
  40. }