annotate ServerMonitor/Forms/UpdateDialog.cs @ 16:7626b099aefd

More comments.
author Brad Greco <brad@bgreco.net>
date Tue, 30 Apr 2019 20:40:58 -0400
parents 9e77c0dccb66
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
1 using System;
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
2 using System.Drawing;
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
3 using System.Windows.Forms;
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
4
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
5 namespace ServerMonitorApp
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
6 {
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
7 /// <summary>Message dialog with an additional checkbox.</summary>
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
8 public partial class UpdateDialog : Form
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
9 {
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
10 /// <summary>Message to show.</summary>
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
11 public string Message { get; set; }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
12
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
13 /// <summary>Check state of the checkbox.</summary>
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
14 public bool Checked { get; private set; }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
15
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
16 public UpdateDialog()
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
17 {
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
18 InitializeComponent();
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
19 }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
20
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
21 private void CheckBoxDialog_Load(object sender, EventArgs e)
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
22 {
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
23 MessageIcon.Image = SystemIcons.Question.ToBitmap();
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
24 MessageLabel.Text = Message;
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
25 }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
26
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
27 /// <summary>Updates the public property with the checked state so it can be read by the dialog owner.</summary>
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
28 private void PromptCheckBox_CheckedChanged(object sender, EventArgs e)
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
29 {
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
30 Checked = PromptCheckBox.Checked;
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
31 }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
32 }
9e77c0dccb66 Add update checker
Brad Greco <brad@bgreco.net>
parents:
diff changeset
33 }