using Expressive; using InABox.Clients; using InABox.Core; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace Comal.Classes { public enum EventType { AfterSave, Scheduled } public class Event : Entity, IRemotable, IPersistent, ILicense { [UniqueCodeEditor] [EditorSequence(1)] public string Code { get; set; } = ""; [TextBoxEditor] [EditorSequence(2)] public string Description { get; set; } = ""; [EditorSequence(3)] public EventType EventType { get; set; } /// /// Serialised event data. /// [NullEditor] public string Data { get; set; } = ""; [EditorSequence(4)] [ExpressionEditor(null)] public string NotificationExpression { get; set; } = ""; [Comment("Sets whether notifications are automatically sent when the event triggers. If false, the notifications must be manually sent by the event actions.")] [EditorSequence(5)] public bool NotificationsEnabled { get; set; } = true; [EditorSequence(6)] public bool Enabled { get; set; } = true; [Comment("Marks whether non-managers (users without the CanManageEvents security token) can view this event.")] [EditorSequence(7)] public bool Visible { get; set; } = true; static Event() { DefaultColumns.Add(x => x.Code); DefaultColumns.Add(x => x.Description); DefaultColumns.Add(x => x.EventType); } } public class EventLink : EntityLink { [CodePopupEditor(typeof(Event))] public override Guid ID { get; set; } public string Code { get; set; } public string Description { get; set; } } }