view ServerMonitor/Forms/CheckBoxDialog.cs @ 33:69e8ecdbbdd3

Fix schedule time not being saved on daily schedules.
author Brad Greco <brad@bgreco.net>
date Sun, 16 Jun 2019 16:55:37 -0400
parents 7127d5b5ac75
children
line wrap: on
line source

using System;
using System.Drawing;
using System.Windows.Forms;

namespace ServerMonitorApp
{
    /// <summary>Message dialog with an additional checkbox.</summary>
    public partial class CheckBoxDialog : Form
    {
        /// <summary>Message to show.</summary>
        public string Message { get; set; }

        /// <summary>Check state of the checkbox.</summary>
        public bool Checked { get; private set; }

        public CheckBoxDialog()
        {
            InitializeComponent();
        }

        private void CheckBoxDialog_Load(object sender, EventArgs e)
        {
            MessageIcon.Image = SystemIcons.Question.ToBitmap();
            MessageLabel.Text = Message;
        }

        /// <summary>Updates the public property with the checked state so it can be read by the dialog owner.</summary>
        private void PromptCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            Checked = PromptCheckBox.Checked;
        }
    }
}