annotate ServerMonitor/Controls/SizeUnitsComboBox.cs @ 32:2342e9459444

Fix schedule times not being saved.
author Brad Greco <brad@bgreco.net>
date Sun, 16 Jun 2019 16:55:14 -0400
parents 68d7834dc28e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
7127d5b5ac75 Code cleanup and comments
Brad Greco <brad@bgreco.net>
parents: 3
diff changeset
1 using System.Windows.Forms;
3
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
2
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
3 namespace ServerMonitorApp
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
4 {
9
7127d5b5ac75 Code cleanup and comments
Brad Greco <brad@bgreco.net>
parents: 3
diff changeset
5 /// <summary>Combo box containing options for size units.</summary>
3
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
6 class SizeUnitsComboBox : ComboBox
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
7 {
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
8 protected override void OnCreateControl()
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
9 {
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
10 base.OnCreateControl();
9
7127d5b5ac75 Code cleanup and comments
Brad Greco <brad@bgreco.net>
parents: 3
diff changeset
11 // Clear the items to prevent duplicates added at design time and run time.
3
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
12 Items.Clear();
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
13 Items.Add("B");
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
14 Items.Add("KB");
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
15 Items.Add("MB");
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
16 Items.Add("GB");
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
17 SelectedIndex = 0;
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
18 }
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
19 }
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
20
9
7127d5b5ac75 Code cleanup and comments
Brad Greco <brad@bgreco.net>
parents: 3
diff changeset
21 /// <summary>Size units.</summary>
17
68d7834dc28e More comments.
Brad Greco <brad@bgreco.net>
parents: 9
diff changeset
22 /// <remarks>The integer values must equal the power of 1024 needed to convert from bytes to each unit.</remarks>
3
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
23 public enum SizeUnits { B = 0, KB = 1, MB = 2, GB = 3 }
96f0b028176d File check
Brad Greco <brad@bgreco.net>
parents:
diff changeset
24 }