| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using System;
- namespace InABox.Core
- {
- public interface IEntityDocument<T> : IEntityDocument where T : IEntityLink
- {
- new T Entity { get; }
- [Obsolete("Replaced by Entity")]
- [ObsoleteProperty(nameof(Entity))]
- new T EntityLink { get; }
- IEntityLink IEntityDocument.Entity => Entity;
- [Obsolete]
- [ObsoleteProperty(nameof(Entity))]
- IEntityLink IEntityDocument.EntityLink => EntityLink;
- }
- [UserTracking(typeof(User))]
- public abstract class EntityDocument<T> : Entity, IPersistent, IRemotable, IEntityDocument<T> where T : BaseObject, IEntityLink, new()
- {
- [EntityRelationship(DeleteAction.SetNull)]
- [EditorSequence(2)]
- public DocumentTypeLink Type => InitializeField(ref _type, nameof(Type));
- private DocumentTypeLink? _type;
- [EntityRelationship(DeleteAction.Cascade)]
- [NullEditor]
- public T Entity => InitializeField(ref _entity, nameof(Entity));
- private T? _entity;
- [Obsolete("Replaced with Entity")]
- [ObsoleteProperty(nameof(Entity))]
- public T EntityLink
- {
- get => Entity;
- set { }
- }
-
- [EntityRelationship(DeleteAction.Cascade)]
- [EditorSequence(1)]
- public DocumentLink Document => InitializeField(ref _document, nameof(Document));
- private DocumentLink? _document;
- [Obsolete("Replaced with Document")]
- [ObsoleteProperty(nameof(Document))]
- public DocumentLink DocumentLink
- {
- get => Document;
- set { }
- }
- [TimestampEditor(Visible = Visible.Optional)]
- [EditorSequence(3)]
- public DateTime Superceded { get; set; }
- [NullEditor]
- public byte[]? Thumbnail { get; set; }
-
- [MemoEditor]
- public String Notes { get; set; }
- //[NullEditor]
- //public string Annotations { get; set; }
- }
- public enum EntityDocumentAnnotationType
- {
- Line,
- Ellipse,
- Rectangle,
- Text,
- Ink,
- OKStamp,
- WarningStamp,
- ErrorStamp,
- Popup
- }
- [UserTracking(typeof(User))]
- public class EntityDocumentAnnotation : Entity, IPersistent, IRemotable, ILicense<CoreLicense>
- {
- public Guid EntityDocument { get; set; }
- public int Page { get; set; }
- public EntityDocumentAnnotationType Type { get; set; }
- public string Data { get; set; } = "";
- }
- }
|