private void OpenRuleFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "YASAT Rules File (*.xml)|*.xml"; ofd.Multiselect = true; ofd.FilterIndex = 0; if (ofd.ShowDialog().Value) { ResetState(); List <string> realFiles = new List <string>(); foreach (string file in ofd.FileNames) { if (File.Exists(file)) { realFiles.Add(file); } } if (realFiles.Count > 0) { rules = RuleManager.GetRulesFromFiles(realFiles); } } RefreshUI(); }