Mercurial > servermonitor
diff ServerMonitor/Forms/UpdateDialog.cs @ 10:9e77c0dccb66
Add update checker
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Mon, 08 Apr 2019 21:31:03 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ServerMonitor/Forms/UpdateDialog.cs Mon Apr 08 21:31:03 2019 -0400 @@ -0,0 +1,33 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ServerMonitorApp +{ + /// <summary>Message dialog with an additional checkbox.</summary> + public partial class UpdateDialog : 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 UpdateDialog() + { + 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; + } + } +}