using System;
using System.Windows.Forms;

namespace HwComWrapperNETGui.UserControls
{
    public partial class MsgCat05 : UserControl
    {
        #region Constructors and Destructors

        public MsgCat05()
        {
            this.InitializeComponent();

            this.button02.Click += (sender, args) => this.HandleButtonClick(this.ButtonAppStartClicked);
            this.button03.Click += (sender, args) => this.HandleButtonClick(this.ButtonAppStopClicked);
            this.button07.Click += (sender, args) => this.HandleButtonClick(this.ButtonStatusClicked);
        }

        #endregion

        #region Public Events

        /// <summary>
        ///     Occurs when the get button for COM_AppStartReq was clicked. 
        /// </summary>
        public event EventHandler ButtonAppStartClicked;

        /// <summary>
        ///     Occurs when the get button for COM_AppStopReq was clicked. 
        /// </summary>
        public event EventHandler ButtonAppStopClicked;
        
        /// <summary>
        ///     Occurs when the get button for COM_StatusReq was clicked. 
        /// </summary>
        public event EventHandler ButtonStatusClicked;

        #endregion

        #region Methods

        private void HandleButtonClick(EventHandler handler)
        {
            if (handler != null)
            {
                handler(this, EventArgs.Empty);
            }
        }

        #endregion
    }
}