EventDescriptor.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Edge.Core.UniversalApi
  5. {
  6. /// <summary>
  7. /// litefcccore fire an event to notify outside clients.
  8. /// </summary>
  9. public class EventDescriptor
  10. {
  11. public string Name { get; set; }
  12. public object Data { get; set; }
  13. public IEnumerable<HubClient> ToClients { get; set; }
  14. }
  15. public class HubClient
  16. {
  17. }
  18. public enum GenericAlarmSeverity
  19. {
  20. Fatal,
  21. Error,
  22. Warning,
  23. Information
  24. }
  25. /// <summary>
  26. /// Used for send a simple and unified alarm data to UI.
  27. /// </summary>
  28. public class GenericAlarm
  29. {
  30. public const string UniversalApiEventName = "OnGenericAlarm";
  31. //public string Originator { get; set; }
  32. /// <summary>
  33. /// Gets or sets the alarm message title, LocalizedContent format is support.
  34. /// please keep this shorter for better user exp in UI, and fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  35. /// </summary>
  36. public string Title { get; set; }
  37. /// <summary>
  38. /// Gets or sets the alarm message detail, LocalizedContent format is support.
  39. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  40. /// </summary>
  41. public string Detail { get; set; }
  42. /// <summary>
  43. /// Abstract description for a serial of alarms that could help to group alarms, LocalizedContent format is support.
  44. /// this is mostly used by UI app that providing a group box to group similar alarms.
  45. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  46. /// </summary>
  47. public string Category { get; set; }
  48. /// <summary>
  49. /// Abstract description for a serial of alarms that could help to further group alarms besides Category, LocalizedContent format is support.
  50. /// this is mostly used by UI app that providing a group box to group similar alarms.
  51. /// please fill with multiple languages string, like: lang-en-us:helloWorldlang-zh-ch:你好世界.
  52. /// </summary>
  53. public string SubCategory { get; set; }
  54. /// <summary>
  55. /// Used to store specific business data that the caller may use it when get the historical generic alarms.
  56. /// </summary>
  57. /// <summary>
  58. /// could be anything that recognized by front end(mostly the Web html/javascript).
  59. /// </summary>
  60. public string Action { get; set; }
  61. public GenericAlarmSeverity Severity { get; set; }
  62. /// <summary>
  63. /// alarms with same identity will be treat as the same alarm, thus only the earliest fired single alarm will be persist, following alarms will be ignore for persist.
  64. /// leave this value null or empty will treat every fired alarm is a new one, thus each alarm will be persist.
  65. /// </summary>
  66. //public string Identity { get; set; }
  67. //public DateTime OpeningTimestamp { get; set; }
  68. //public string ClosedReason { get; set; }
  69. //public DateTime? ClosedTimestamp { get; set; }
  70. }
  71. }