EntityDocument.cs 1.5 KB

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