Mercurial > servermonitor
comparison ServerMonitor/Forms/CheckBoxDialog.cs @ 9:7127d5b5ac75
Code cleanup and comments
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Mon, 08 Apr 2019 21:29:54 -0400 |
parents | 3e1a2131f897 |
children |
comparison
equal
deleted
inserted
replaced
8:052aa62cb42a | 9:7127d5b5ac75 |
---|---|
1 using System; | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.ComponentModel; | |
4 using System.Data; | |
5 using System.Drawing; | 2 using System.Drawing; |
6 using System.Linq; | |
7 using System.Text; | |
8 using System.Windows.Forms; | 3 using System.Windows.Forms; |
9 | 4 |
10 namespace ServerMonitorApp | 5 namespace ServerMonitorApp |
11 { | 6 { |
7 /// <summary>Message dialog with an additional checkbox.</summary> | |
12 public partial class CheckBoxDialog : Form | 8 public partial class CheckBoxDialog : Form |
13 { | 9 { |
10 /// <summary>Message to show.</summary> | |
14 public string Message { get; set; } | 11 public string Message { get; set; } |
15 | 12 |
13 /// <summary>Check state of the checkbox.</summary> | |
16 public bool Checked { get; private set; } | 14 public bool Checked { get; private set; } |
17 | 15 |
18 public CheckBoxDialog() | 16 public CheckBoxDialog() |
19 { | 17 { |
20 InitializeComponent(); | 18 InitializeComponent(); |
24 { | 22 { |
25 MessageIcon.Image = SystemIcons.Question.ToBitmap(); | 23 MessageIcon.Image = SystemIcons.Question.ToBitmap(); |
26 MessageLabel.Text = Message; | 24 MessageLabel.Text = Message; |
27 } | 25 } |
28 | 26 |
27 /// <summary>Updates the public property with the checked state so it can be read by the dialog owner.</summary> | |
29 private void PromptCheckBox_CheckedChanged(object sender, EventArgs e) | 28 private void PromptCheckBox_CheckedChanged(object sender, EventArgs e) |
30 { | 29 { |
31 Checked = PromptCheckBox.Checked; | 30 Checked = PromptCheckBox.Checked; |
32 } | 31 } |
33 } | 32 } |