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 = ""; } }
private string RegExOperationConvert(RegExUtil.Operation value) { switch (value) { case RegExUtil.Operation.Contain: return("∈"); case RegExUtil.Operation.Equal: return("="); case RegExUtil.Operation.Less: return("<"); case RegExUtil.Operation.Major: return(">"); case RegExUtil.Operation.NotContain: return("∉"); default: return("∈"); } }