using System.Windows.Forms;
namespace ServerMonitorApp
{
/// Combo box containing options for matching text against a response string.
class MatchComboBox : ComboBox
{
protected override void OnCreateControl()
{
base.OnCreateControl();
// Clear the items to prevent duplicates added at design time and run time.
Items.Clear();
Items.Add("equals");
Items.Add("does not equal");
Items.Add("contains");
Items.Add("does not contain");
Items.Add("is greater than");
Items.Add("is less than");
SelectedIndex = 0;
}
}
/// Types of matches that can be run against a response string.
public enum MatchType
{
/// Indicates that the result string must equal the expected pattern.
Equals = 0,
/// Indicates that the result string must not equal the expected pattern.
NotEquals = 1,
/// Indicates that the result string must contain expected pattern.
Contains = 2,
/// Indicates that the result string must not contain expected pattern.
NotContains = 3,
/// Indicates that the result string must be numeric and greater than the expected numeric pattern.
GreaterThan = 4,
/// Indicates that the result string must be numeric and less than the expected numeric pattern.
LessThan = 5
}
}