10
|
1 using System;
|
|
2 using System.Drawing;
|
|
3 using System.Windows.Forms;
|
|
4
|
|
5 namespace ServerMonitorApp
|
|
6 {
|
|
7 /// <summary>Message dialog with an additional checkbox.</summary>
|
|
8 public partial class UpdateDialog : Form
|
|
9 {
|
|
10 /// <summary>Message to show.</summary>
|
|
11 public string Message { get; set; }
|
|
12
|
|
13 /// <summary>Check state of the checkbox.</summary>
|
|
14 public bool Checked { get; private set; }
|
|
15
|
|
16 public UpdateDialog()
|
|
17 {
|
|
18 InitializeComponent();
|
|
19 }
|
|
20
|
|
21 private void CheckBoxDialog_Load(object sender, EventArgs e)
|
|
22 {
|
|
23 MessageIcon.Image = SystemIcons.Question.ToBitmap();
|
|
24 MessageLabel.Text = Message;
|
|
25 }
|
|
26
|
|
27 /// <summary>Updates the public property with the checked state so it can be read by the dialog owner.</summary>
|
|
28 private void PromptCheckBox_CheckedChanged(object sender, EventArgs e)
|
|
29 {
|
|
30 Checked = PromptCheckBox.Checked;
|
|
31 }
|
|
32 }
|
|
33 }
|