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

Code cleanup and comments
author Brad Greco <brad@bgreco.net>
date Mon, 08 Apr 2019 21:29:54 -0400
parents 9e92780ebc0f
children 7626b099aefd
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 matching text against a response string.</summary>
9 class MatchComboBox : ComboBox 6 class MatchComboBox : 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("equals"); 13 Items.Add("equals");
16 Items.Add("does not equal"); 14 Items.Add("does not equal");
17 Items.Add("contains"); 15 Items.Add("contains");
18 Items.Add("does not contain"); 16 Items.Add("does not contain");
20 Items.Add("is less than"); 18 Items.Add("is less than");
21 SelectedIndex = 0; 19 SelectedIndex = 0;
22 } 20 }
23 } 21 }
24 22
23 /// <summary>Types of matches that can be run against a response string.</summary>
25 public enum MatchType { Equals = 0, NotEquals = 1, Contains = 2, NotContains = 3, GreaterThan = 4, LessThan = 5 } 24 public enum MatchType { Equals = 0, NotEquals = 1, Contains = 2, NotContains = 3, GreaterThan = 4, LessThan = 5 }
26 } 25 }