12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #region --------------- Copyright Dresser Wayne Pignone -------------
- /*
- * $Log: /Wrk/Support/ForecourtControl/Wrk/ForecourtControl/EventArgs/TankLevelSwitchStatusChangeEventArgs.cs $
- *
- * 1 07-05-21 16:27 roger.månsson
- * Created.
- */
- #endregion
- using System;
- namespace Wayne.ForecourtControl
- {
- /// <summary>
- /// Event argument for a PumpStateChange Event.
- /// </summary>
- public class TankLevelSwitchStatusChangeEventArgs : EventArgs
- {
- #region Fields
- private IPump pump;
- private TankLevelSwitchStatus tankLevelSwitchStatus;
- #endregion
- #region Constructor
- /// <summary>
- /// Constructor
- /// </summary>
- /// <param name="pump"></param>
- /// <param name="tankLevelSwitchStatus">The new tank level switch status.</param>
- public TankLevelSwitchStatusChangeEventArgs(IPump pump, TankLevelSwitchStatus tankLevelSwitchStatus)
- {
- this.pump = pump;
- this.tankLevelSwitchStatus = tankLevelSwitchStatus;
- }
- #endregion
- #region Properties
- /// <summary>
- /// The new Pump state.
- /// </summary>
- public TankLevelSwitchStatus TankLevelSwitchStatus { get { return tankLevelSwitchStatus; } }
- /// <summary>
- /// The Pump whose state was changed.
- /// </summary>
- public IPump Pump
- {
- get { return pump; }
- set { pump = value; }
- }
- #endregion
- #region Debug methods
- /// <summary>
- /// Presents the class as a string.
- /// </summary>
- /// <returns></returns>
- public virtual string ToString(string format, IFormatProvider provider)
- {
- return String.Format(System.Globalization.CultureInfo.InvariantCulture, "TankLevelSwitchStatusChange PumpId={0}, TankLevelSwitchStatus={1}", pump.Id, tankLevelSwitchStatus.ToString()); ;
- }
- /// <summary>
- /// Presents the class as a string using the specified culture-specific format information.
- /// </summary>
- /// <returns></returns>
- public virtual string ToString(IFormatProvider provider)
- {
- return ToString("", provider);
- }
- /// <summary>
- /// Presents the class as a string using a format string.
- /// </summary>
- /// <returns></returns>
- public virtual string ToString(string format)
- {
- return ToString(format, System.Globalization.CultureInfo.InvariantCulture);
- }
- /// <summary>
- /// Presents the class as a string using a format string and the specified culture-specific format information.
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return ToString("", System.Globalization.CultureInfo.InvariantCulture);
- }
- #endregion
- }
- }
|