view ServerMonitor/Controls/MatchComboBox.cs @ 32:2342e9459444

Fix schedule times not being saved.
author Brad Greco <brad@bgreco.net>
date Sun, 16 Jun 2019 16:55:14 -0400
parents 7626b099aefd
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
    }
}