using System;
using System.Drawing;
using System.Windows.Forms;
namespace ServerMonitorApp
{
/// Message dialog with an additional checkbox.
public partial class CheckBoxDialog : Form
{
/// Message to show.
public string Message { get; set; }
/// Check state of the checkbox.
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;
}
/// Updates the public property with the checked state so it can be read by the dialog owner.
private void PromptCheckBox_CheckedChanged(object sender, EventArgs e)
{
Checked = PromptCheckBox.Checked;
}
}
}