示例#1
0
        public static string GetMatchTypeString(eRuleMatchType mt)
        {
            string result;

            switch (mt)
            {
            case eRuleMatchType.eMTContains:
                result = "Contains";
                break;

            case eRuleMatchType.eMTEquals:
                result = "Equals";
                break;

            case eRuleMatchType.eMTGreaterThan:
                result = "Greater than";
                break;

            case eRuleMatchType.eMTLessThan:
                result = "Less than";
                break;

            case eRuleMatchType.eMTNotContains:
                result = "Not contains";
                break;

            case eRuleMatchType.eMTNotEquals:
                result = "Not equals";
                break;

            case eRuleMatchType.eMTRegExMatch:
                result = "Regular expression";
                break;

            case eRuleMatchType.eMTUnknown:
                result = "Unknown";
                break;

            case eRuleMatchType.eMTWildcard:
                result = "Wildcard";
                break;

            default:
                result = "Unknown";
                break;
            }

            return(Strings.Localize(result));
        }
示例#2
0
        public static string GetMatchTypeString(eRuleMatchType mt)
        {
            string result;
             switch (mt)
             {
            case eRuleMatchType.eMTContains:
               result = "Contains";
               break;
            case eRuleMatchType.eMTEquals:
               result = "Equals";
               break;
            case eRuleMatchType.eMTGreaterThan:
               result = "Greater than";
               break;
            case eRuleMatchType.eMTLessThan:
               result = "Less than";
               break;
            case eRuleMatchType.eMTNotContains:
               result = "Not contains";
               break;
            case eRuleMatchType.eMTNotEquals:
               result = "Not equals";
               break;
            case eRuleMatchType.eMTRegExMatch:
               result = "Regular expression";
               break;
            case eRuleMatchType.eMTUnknown:
               result =  "Unknown";
               break;
            case eRuleMatchType.eMTWildcard:
               result =  "Wildcard";
               break;
            default:
               result = "Unknown";
               break;
             }

             return Strings.Localize(result);
        }
示例#3
0
        private void RunTest()
        {
            if (comboSearchType.SelectedValue == null)
            {
                labelTestResult.Text = "";
                return;
            }

            string         matchValue = txtMatchValue.Text;
            string         testValue  = textTestValue.Text;
            eRuleMatchType matchType  = (eRuleMatchType)comboSearchType.SelectedValue;

            if (string.IsNullOrEmpty(testValue))
            {
                labelTestResult.Text = "";
                return;
            }

            bool match = _utilities.CriteriaMatch(matchValue, matchType, testValue);

            labelTestResult.Text = match ? Strings.Localize("Match") : Strings.Localize("No match");
        }