EntityDocument.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. [MemoEditor]
  26. public String Notes { get; set; }
  27. //[NullEditor]
  28. //public string Annotations { get; set; }
  29. }
  30. public enum EntityDocumentAnnotationType
  31. {
  32. Line,
  33. Ellipse,
  34. Rectangle,
  35. Text,
  36. Ink,
  37. OKStamp,
  38. WarningStamp,
  39. ErrorStamp
  40. }
  41. [UserTracking(typeof(User))]
  42. public class EntityDocumentAnnotation : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
  43. {
  44. public Guid EntityDocument { get; set; }
  45. public int Page { get; set; }
  46. public EntityDocumentAnnotationType Type { get; set; }
  47. public string Data { get; set; } = "";
  48. }
  49. }