AlarmEventArgs.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System;
  2. namespace Wayne.ForecourtControl
  3. {
  4. /// <summary>
  5. /// Event argument for an Alarm event.
  6. /// </summary>
  7. public sealed class AlarmEventArgs : EventArgs, Wayne.ForecourtControl.Com.IAlarmEventArgs
  8. {
  9. #region Fields
  10. int deviceId;
  11. int deviceType;
  12. int alarmCode;
  13. int alarmCategory;
  14. string debugText;
  15. #endregion
  16. #region Construction
  17. /// <summary>
  18. /// Initializes a new instance of the AlarmEventArgs class.
  19. /// </summary>
  20. /// <param name="deviceId">Device id for the device that the alarm is about</param>
  21. /// <param name="deviceType">Type of device</param>
  22. /// <param name="alarmCode">Alarm code.</param>
  23. /// <param name="alarmCategory">Category of the alarm.</param>
  24. /// <param name="debugText">Debug text.</param>
  25. public AlarmEventArgs(int deviceId, int deviceType, int alarmCode, int alarmCategory, string debugText)
  26. {
  27. this.deviceId = deviceId;
  28. this.deviceType = deviceType;
  29. this.alarmCode = alarmCode;
  30. this.alarmCategory = alarmCategory;
  31. this.debugText = debugText;
  32. }
  33. #endregion
  34. #region Properties
  35. /// <summary>
  36. /// Device id for the device that the alarm was about.
  37. /// </summary>
  38. public int DeviceId
  39. {
  40. get { return deviceId; }
  41. }
  42. /// <summary>
  43. /// Type of device.
  44. /// </summary>
  45. public int DeviceType
  46. {
  47. get { return deviceType; }
  48. set { deviceType = value; }
  49. }
  50. /// <summary>
  51. /// Alarm code.
  52. /// </summary>
  53. public int AlarmCode
  54. {
  55. get { return alarmCode; }
  56. set { alarmCode = value; }
  57. }
  58. /// <summary>
  59. /// Category of the alarm
  60. /// </summary>
  61. public int AlarmCategory
  62. {
  63. get { return alarmCategory; }
  64. set { alarmCategory = value; }
  65. }
  66. /// <summary>
  67. /// Debug text for the alarm.
  68. /// </summary>
  69. public string DebugText
  70. {
  71. get { return debugText; }
  72. set { debugText = value; }
  73. }
  74. #endregion
  75. #region Methods
  76. /// <summary>
  77. /// ToString
  78. /// </summary>
  79. /// <returns></returns>
  80. public override string ToString()
  81. {
  82. return string.Format(System.Globalization.CultureInfo.InvariantCulture, "AlarmEventArgs(DeviceId={0},DeviceType={1},AlarmCode={2},AlarmCategory={3},DebugText={4})", deviceId, deviceType, alarmCode, alarmCategory, debugText);
  83. }
  84. #endregion
  85. }
  86. }