comparison ServerMonitor/Controls/TimeUnitsComboBox.cs @ 9:7127d5b5ac75

Code cleanup and comments
author Brad Greco <brad@bgreco.net>
date Mon, 08 Apr 2019 21:29:54 -0400
parents 96f0b028176d
children
comparison
equal deleted inserted replaced
8:052aa62cb42a 9:7127d5b5ac75
1 using System; 1 using System.Windows.Forms;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows.Forms;
6 2
7 namespace ServerMonitorApp 3 namespace ServerMonitorApp
8 { 4 {
5 /// <summary>Combo box containing options for time units.</summary>
9 class TimeUnitsComboBox : ComboBox 6 class TimeUnitsComboBox : ComboBox
10 { 7 {
11 protected override void OnCreateControl() 8 protected override void OnCreateControl()
12 { 9 {
13 base.OnCreateControl(); 10 base.OnCreateControl();
11 // Clear the items to prevent duplicates added at design time and run time.
14 Items.Clear(); 12 Items.Clear();
15 Items.Add("minutes"); 13 Items.Add("minutes");
16 Items.Add("hours"); 14 Items.Add("hours");
17 Items.Add("days"); 15 Items.Add("days");
18 SelectedIndex = 2; 16 SelectedIndex = 2;
19 } 17 }
20 } 18 }
21 19
20 /// <summary>Time units.</summary>
22 public enum TimeUnits { Minute = 0, Hour = 1, Day = 2 } 21 public enum TimeUnits { Minute = 0, Hour = 1, Day = 2 }
23 } 22 }