EntityDocument.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. namespace InABox.Core
  3. {
  4. public interface IEntityDocument<T> : IEntityDocument where T : IEntityLink
  5. {
  6. T EntityLink { get; }
  7. }
  8. [UserTracking(typeof(User))]
  9. public abstract class EntityDocument<T> : Entity, IPersistent, IRemotable, IEntityDocument<T> where T : BaseObject, IEntityLink, new()
  10. {
  11. [EntityRelationship(DeleteAction.SetNull)]
  12. [EditorSequence(2)]
  13. public DocumentTypeLink Type => InitializeField(ref _type, nameof(Type));
  14. private DocumentTypeLink? _type;
  15. [EntityRelationship(DeleteAction.Cascade)]
  16. [NullEditor]
  17. public T EntityLink => InitializeField(ref _entityLink, nameof(EntityLink));
  18. private T? _entityLink;
  19. [EntityRelationship(DeleteAction.Cascade)]
  20. [EditorSequence(1)]
  21. public DocumentLink DocumentLink => InitializeField(ref _documentLink, nameof(DocumentLink));
  22. private DocumentLink? _documentLink;
  23. [TimestampEditor(Visible = Visible.Optional)]
  24. [EditorSequence(3)]
  25. public DateTime Superceded { get; set; }
  26. [NullEditor]
  27. public byte[]? Thumbnail { get; set; }
  28. [MemoEditor]
  29. public String Notes { get; set; }
  30. //[NullEditor]
  31. //public string Annotations { get; set; }
  32. }
  33. public enum EntityDocumentAnnotationType
  34. {
  35. Line,
  36. Ellipse,
  37. Rectangle,
  38. Text,
  39. Ink,
  40. OKStamp,
  41. WarningStamp,
  42. ErrorStamp
  43. }
  44. [UserTracking(typeof(User))]
  45. public class EntityDocumentAnnotation : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
  46. {
  47. public Guid EntityDocument { get; set; }
  48. public int Page { get; set; }
  49. public EntityDocumentAnnotationType Type { get; set; }
  50. public string Data { get; set; } = "";
  51. }
  52. }