private void RegExMetricCriticalGenAdd_Click(object sender, RoutedEventArgs e)
        {
            if (MonitoringIndicatorList.SelectedItem != null)
            {
                RegExUtil.Operation op = RegExOperationConvertBack(this.RegExGenMetricCriticalOp.SelectedItem as string);
                string part            = RegExUtility.GenerateRegEx(RegExGeneratorMetricCritical.Text, op);
                string oldRegEx        = (MonitoringIndicatorList.SelectedItem as Indicator).StatementCritical;

                var mergeList = new List <string>();
                mergeList.Add(oldRegEx);
                mergeList.Add(part);

                (MonitoringIndicatorList.SelectedItem as Indicator).StatementCritical = RegExUtility.MergeRegEx(mergeList);
                RegExGeneratorMetricCritical.Text = "";
            }
        }
Example #2
0
        private string RegExOperationConvert(RegExUtil.Operation value)
        {
            switch (value)
            {
            case RegExUtil.Operation.Contain:
                return("&#8712;");

            case RegExUtil.Operation.Equal:
                return("=");

            case RegExUtil.Operation.Less:
                return("&lt;");

            case RegExUtil.Operation.Major:
                return("&gt;");

            case RegExUtil.Operation.NotContain:
                return("&#8713;");

            default:
                return("&#8712;");
            }
        }