using System;

namespace Wayne.ForecourtControl
{
    /// <summary>
    /// Event argument for an Alarm event.
    /// </summary>
    public sealed class AlarmEventArgs : EventArgs, Wayne.ForecourtControl.Com.IAlarmEventArgs
    {
        #region Fields

        int deviceId;
        int deviceType;
        int alarmCode;
        int alarmCategory;
        string debugText;

        #endregion

        #region Construction

        /// <summary>
        /// Initializes a new instance of the AlarmEventArgs class.
        /// </summary>
        /// <param name="deviceId">Device id for the device that the alarm is about</param>
        /// <param name="deviceType">Type of device</param>
        /// <param name="alarmCode">Alarm code.</param>
        /// <param name="alarmCategory">Category of the alarm.</param>
        /// <param name="debugText">Debug text.</param>
        public AlarmEventArgs(int deviceId, int deviceType, int alarmCode, int alarmCategory, string debugText)
        {
            this.deviceId = deviceId;
            this.deviceType = deviceType;
            this.alarmCode = alarmCode;
            this.alarmCategory = alarmCategory;
            this.debugText = debugText;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Device id for the device that the alarm was about.
        /// </summary>
        public int DeviceId
        {
            get { return deviceId; }            
        }

        /// <summary>
        /// Type of device.
        /// </summary>
        public int DeviceType
        {
            get { return deviceType; }
            set { deviceType = value; }
        }

        /// <summary>
        /// Alarm code.
        /// </summary>
        public int AlarmCode
        {
            get { return alarmCode; }
            set { alarmCode = value; }
        }

        /// <summary>
        /// Category of the alarm
        /// </summary>
        public int AlarmCategory
        {
            get { return alarmCategory; }
            set { alarmCategory = value; }
        }

        /// <summary>
        /// Debug text for the alarm.
        /// </summary>
        public string DebugText
        {
            get { return debugText; }
            set { debugText = value; }
        }


        #endregion

        #region Methods

        /// <summary>
        /// ToString
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format(System.Globalization.CultureInfo.InvariantCulture, "AlarmEventArgs(DeviceId={0},DeviceType={1},AlarmCode={2},AlarmCategory={3},DebugText={4})", deviceId, deviceType, alarmCode, alarmCategory, debugText);
        }
        #endregion 
    }
}