TankLevelSwitchStatusChangeEventArgs.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #region --------------- Copyright Dresser Wayne Pignone -------------
  2. /*
  3. * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/EventArgs/TankLevelSwitchStatusChangeEventArgs.cs $
  4. *
  5. * 1 07-05-21 16:27 roger.månsson
  6. * Created.
  7. */
  8. #endregion
  9. using System;
  10. namespace Wayne.ForecourtControl
  11. {
  12. /// <summary>
  13. /// Event argument for a PumpStateChange Event.
  14. /// </summary>
  15. public class TankLevelSwitchStatusChangeEventArgs : EventArgs
  16. {
  17. #region Fields
  18. private IPump pump;
  19. private TankLevelSwitchStatus tankLevelSwitchStatus;
  20. #endregion
  21. #region Constructor
  22. /// <summary>
  23. /// Constructor
  24. /// </summary>
  25. /// <param name="pump"></param>
  26. /// <param name="tankLevelSwitchStatus">The new tank level switch status.</param>
  27. public TankLevelSwitchStatusChangeEventArgs(IPump pump, TankLevelSwitchStatus tankLevelSwitchStatus)
  28. {
  29. this.pump = pump;
  30. this.tankLevelSwitchStatus = tankLevelSwitchStatus;
  31. }
  32. #endregion
  33. #region Properties
  34. /// <summary>
  35. /// The new Pump state.
  36. /// </summary>
  37. public TankLevelSwitchStatus TankLevelSwitchStatus { get { return tankLevelSwitchStatus; } }
  38. /// <summary>
  39. /// The Pump whose state was changed.
  40. /// </summary>
  41. public IPump Pump
  42. {
  43. get { return pump; }
  44. set { pump = value; }
  45. }
  46. #endregion
  47. #region Debug methods
  48. /// <summary>
  49. /// Presents the class as a string.
  50. /// </summary>
  51. /// <returns></returns>
  52. public virtual string ToString(string format, IFormatProvider provider)
  53. {
  54. return String.Format(System.Globalization.CultureInfo.InvariantCulture, "TankLevelSwitchStatusChange PumpId={0}, TankLevelSwitchStatus={1}", pump.Id, tankLevelSwitchStatus.ToString()); ;
  55. }
  56. /// <summary>
  57. /// Presents the class as a string using the specified culture-specific format information.
  58. /// </summary>
  59. /// <returns></returns>
  60. public virtual string ToString(IFormatProvider provider)
  61. {
  62. return ToString("", provider);
  63. }
  64. /// <summary>
  65. /// Presents the class as a string using a format string.
  66. /// </summary>
  67. /// <returns></returns>
  68. public virtual string ToString(string format)
  69. {
  70. return ToString(format, System.Globalization.CultureInfo.InvariantCulture);
  71. }
  72. /// <summary>
  73. /// Presents the class as a string using a format string and the specified culture-specific format information.
  74. /// </summary>
  75. /// <returns></returns>
  76. public override string ToString()
  77. {
  78. return ToString("", System.Globalization.CultureInfo.InvariantCulture);
  79. }
  80. #endregion
  81. }
  82. }