示例#1
0
        private void DeleteRule_Click(object sender, RoutedEventArgs e)
        {
            List <string> rulesToRemove = new List <string>(lbInstructions.SelectedItems.Cast <string>().ToList());

            foreach (string rule in rulesToRemove)
            {
                UIInstructions.Remove(rule);
                Instructions.Remove(rule);
                Excluders.Remove(rule);
            }
        }
示例#2
0
 private void PropertyValueExcluderTrigger_Click(object sender, RoutedEventArgs e)
 {
     if (PropertyValueExcluder_Cb.SelectedIndex != -1 && !string.IsNullOrEmpty(PropertyToExclude_tb.Text))
     {
         Excluders.Add(syntaxWriter.WritePropertyValueExcluder(PropertyValueExcluder_Cb.Text, PropertyToExclude_tb.Text));
         UIInstructions.Add(syntaxWriter.WritePropertyValueExcluder(PropertyValueExcluder_Cb.Text, PropertyToExclude_tb.Text));
         PropertyValueExcluder_Cb.ItemsSource = new List <string>();
         PropertyToExclude_tb.Text            = "";
         MapperGrid.Visibility = Visibility.Visible;
         PropertyValueExcluderGrid.Visibility = Visibility.Hidden;
         MapBtn.IsEnabled = true;
     }
 }
示例#3
0
        private void LoadRule_Click(object sender, RoutedEventArgs e)
        {
            List <string> loadedRules = new List <string>(ruleService.LoadRules());

            UIInstructions.Clear();
            loadedRules.ForEach(rule => UIInstructions.Add(rule));
            Excluders = loadedRules.FindAll(excludeRule => excludeRule.Contains("Excluder"));
            loadedRules.RemoveAll(rule => Excluders.Contains(rule));
            Instructions = loadedRules;
            if (UIInstructions.Count > 0)
            {
                MapBtn.IsEnabled = true;
            }
        }