diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs index a7dfd30..cef6e1a 100644 --- a/Sources/Model/Manager.cs +++ b/Sources/Model/Manager.cs @@ -55,5 +55,34 @@ namespace Model } return fdd; } + + public List RechercheFDD(string text,List listeFDD) + { + if (text == "") { + return listeFDD; + } + foreach(FruitDuDemon f in listeFDD.ToList()) + { + bool correspondance = false; + int textPos = 0; + for (int i = 0; i < (f.Nom.Length); i++) { + if (string.Equals(text[textPos].ToString(), f.Nom[i].ToString(), StringComparison.OrdinalIgnoreCase)) + { + textPos++; + } + if(textPos == text.Length) + { + correspondance = true; + break; + } + + } + if (!correspondance) + { + listeFDD.Remove(f); + } + } + return listeFDD; + } } } diff --git a/Sources/Ohara/PageFDD.xaml b/Sources/Ohara/PageFDD.xaml index dabb1ed..9835db0 100644 --- a/Sources/Ohara/PageFDD.xaml +++ b/Sources/Ohara/PageFDD.xaml @@ -4,8 +4,8 @@ x:Class="Ohara.PageFDD" Title="PageFDD" BackgroundColor="#e2edf1"> - + @@ -34,6 +34,7 @@