Event.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Expressive;
  2. using InABox.Clients;
  3. using InABox.Core;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading;
  10. namespace Comal.Classes
  11. {
  12. public enum EventType
  13. {
  14. AfterSave,
  15. Scheduled
  16. }
  17. public class Event : Entity, IRemotable, IPersistent, ILicense<CoreLicense>
  18. {
  19. [UniqueCodeEditor]
  20. [EditorSequence(1)]
  21. public string Code { get; set; } = "";
  22. [TextBoxEditor]
  23. [EditorSequence(2)]
  24. public string Description { get; set; } = "";
  25. [EditorSequence(3)]
  26. public EventType EventType { get; set; }
  27. /// <summary>
  28. /// Serialised event data.
  29. /// </summary>
  30. [NullEditor]
  31. public string Data { get; set; } = "";
  32. [EditorSequence(4)]
  33. [ExpressionEditor(null)]
  34. public string NotificationExpression { get; set; } = "";
  35. [EditorSequence(5)]
  36. public bool Enabled { get; set; } = true;
  37. [Comment("Marks whether non-managers (users without the CanManageEvents security token) can view this event.")]
  38. [EditorSequence(6)]
  39. public bool Visible { get; set; } = true;
  40. static Event()
  41. {
  42. DefaultColumns.Add<Event>(x => x.Code);
  43. DefaultColumns.Add<Event>(x => x.Description);
  44. DefaultColumns.Add<Event>(x => x.EventType);
  45. }
  46. }
  47. public class EventLink : EntityLink<Event>
  48. {
  49. [CodePopupEditor(typeof(Event))]
  50. public override Guid ID { get; set; }
  51. public string Code { get; set; }
  52. public string Description { get; set; }
  53. }
  54. }