From 80cd47c78fbbac8ab4b03aab670431bd1628958a Mon Sep 17 00:00:00 2001 From: jamckee Date: Sun, 5 May 2019 13:12:46 -0600 Subject: [PATCH] Added wildcard search to add multiple dinos --- LarkatorGUI/MainWindow.xaml | 2 +- LarkatorGUI/MainWindow.xaml.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/LarkatorGUI/MainWindow.xaml b/LarkatorGUI/MainWindow.xaml index 4821af0..91c9d67 100644 --- a/LarkatorGUI/MainWindow.xaml +++ b/LarkatorGUI/MainWindow.xaml @@ -316,7 +316,7 @@ - + diff --git a/LarkatorGUI/MainWindow.xaml.cs b/LarkatorGUI/MainWindow.xaml.cs index 99b3983..f119d8f 100644 --- a/LarkatorGUI/MainWindow.xaml.cs +++ b/LarkatorGUI/MainWindow.xaml.cs @@ -525,7 +525,11 @@ private void Dev_DummyData_Click(object sender, MouseButtonEventArgs e) private void SaveSearch_Click(object sender, RoutedEventArgs e) { + List NewSearchList; + SearchCriteria tempSearch; if (String.IsNullOrWhiteSpace(NewSearch.Species)) return; + NewSearchList = new List(AllSpecies.Where(species => species.Contains(NewSearch.Species))); + if (NewSearchList.Count == 0) return; // No matches try { @@ -534,8 +538,15 @@ private void SaveSearch_Click(object sender, RoutedEventArgs e) catch (InvalidOperationException) // no entries for .Max - ignore { } - ListSearches.Add(NewSearch); + foreach (String newDino in NewSearchList) + { + tempSearch = new SearchCriteria(NewSearch); + tempSearch.Species = newDino; + ListSearches.Add(tempSearch); + } + NewSearch = null; + tempSearch = null; NewSearchActive = false; CreateSearchAvailable = true;