9
|
1 using System.Windows.Forms;
|
3
|
2
|
|
3 namespace ServerMonitorApp
|
|
4 {
|
9
|
5 /// <summary>Combo box containing options for time units.</summary>
|
3
|
6 class TimeUnitsComboBox : ComboBox
|
|
7 {
|
|
8 protected override void OnCreateControl()
|
|
9 {
|
|
10 base.OnCreateControl();
|
9
|
11 // Clear the items to prevent duplicates added at design time and run time.
|
3
|
12 Items.Clear();
|
|
13 Items.Add("minutes");
|
|
14 Items.Add("hours");
|
|
15 Items.Add("days");
|
|
16 SelectedIndex = 2;
|
|
17 }
|
|
18 }
|
|
19
|
9
|
20 /// <summary>Time units.</summary>
|
3
|
21 public enum TimeUnits { Minute = 0, Hour = 1, Day = 2 }
|
|
22 }
|