view ServerMonitor/Controls/MatchComboBox.cs @ 16:7626b099aefd

More comments.
author Brad Greco <brad@bgreco.net>
date Tue, 30 Apr 2019 20:40:58 -0400
parents 7127d5b5ac75
children
line wrap: on
line source

´╗┐using System.Windows.Forms;

namespace ServerMonitorApp
{
    /// <summary>Combo box containing options for matching text against a response string.</summary>
    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;
        }
    }

    /// <summary>Types of matches that can be run against a response string.</summary>
    public enum MatchType
    {
        /// <summary>Indicates that the result string must equal the expected pattern.</summary>
        Equals = 0,
        /// <summary>Indicates that the result string must not equal the expected pattern.</summary>
        NotEquals = 1,
        /// <summary>Indicates that the result string must contain expected pattern.</summary>
        Contains = 2,
        /// <summary>Indicates that the result string must not contain expected pattern.</summary>
        NotContains = 3,
        /// <summary>Indicates that the result string must be numeric and greater than the expected numeric pattern.</summary>
        GreaterThan = 4,
        /// <summary>Indicates that the result string must be numeric and less than the expected numeric pattern.</summary>
        LessThan = 5
    }
}