EntityDocument.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. protected override void Init()
  28. {
  29. base.Init();
  30. EntityLink = new T();
  31. DocumentLink = new DocumentLink();
  32. Type = new DocumentTypeLink();
  33. //Annotations = "";
  34. }
  35. }
  36. public enum EntityDocumentAnnotationType
  37. {
  38. Line,
  39. Ellipse,
  40. Rectangle,
  41. Text,
  42. Ink,
  43. OKStamp,
  44. WarningStamp,
  45. ErrorStamp
  46. }
  47. [UserTracking(typeof(User))]
  48. public class EntityDocumentAnnotation : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
  49. {
  50. public Guid EntityDocument { get; set; }
  51. public int Page { get; set; }
  52. public EntityDocumentAnnotationType Type { get; set; }
  53. public string Data { get; set; }
  54. }
  55. }