Event.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. }
  16. public class Event : Entity, IRemotable, IPersistent, ILicense<CoreLicense>
  17. {
  18. [UniqueCodeEditor]
  19. [EditorSequence(1)]
  20. public string Code { get; set; } = "";
  21. [TextBoxEditor]
  22. [EditorSequence(2)]
  23. public string Description { get; set; } = "";
  24. [EditorSequence(3)]
  25. public EventType EventType { get; set; }
  26. /// <summary>
  27. /// Serialised event data.
  28. /// </summary>
  29. [NullEditor]
  30. public string Data { get; set; } = "";
  31. [EditorSequence(4)]
  32. [ExpressionEditor(null)]
  33. public string NotificationExpression { get; set; } = "";
  34. [EditorSequence(5)]
  35. public bool Enabled { get; set; } = true;
  36. [Comment("Marks whether non-managers (users without the CanManageEvents security token) can view this event.")]
  37. [EditorSequence(6)]
  38. public bool Visible { get; set; } = true;
  39. static Event()
  40. {
  41. DefaultColumns.Add<Event>(x => x.Code);
  42. DefaultColumns.Add<Event>(x => x.Description);
  43. DefaultColumns.Add<Event>(x => x.EventType);
  44. }
  45. }
  46. public class EventLink : EntityLink<Event>
  47. {
  48. [CodePopupEditor(typeof(Event))]
  49. public override Guid ID { get; set; }
  50. public string Code { get; set; }
  51. public string Description { get; set; }
  52. }
  53. }