1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-22 10:03:41 +00:00

Test lien liste filtrée

This commit is contained in:
Yan Maniez 2018-07-31 01:12:19 +02:00
parent 18c1128aed
commit a14e14e8fa
4 changed files with 24 additions and 8 deletions

View file

@ -20,6 +20,7 @@ namespace AideDeJeuLib
"## [États spéciaux](conditions_hd.md)\n\n" +
"## [Sorts](spells_hd.md)\n\n" +
"## [Sorts de mago](spells_hd_with_class_magicien.md)\n\n" +
"## [Armures légères](equipment_hd_with_type_armurelegere.md)\n\n" +
"# MJ\n\n" +
"## [Créatures](monsters_hd.md)\n\n" +
//"## [Mignons](baby_bestiary_hd.md)\n\n" +

View file

@ -100,6 +100,20 @@ namespace AideDeJeu.Tools
return RemoveDiacritics(name.ToLower().Replace(" ", "-")); //.Replace("\'", ""));
}
public static string Simplify(this string text)
{
if (text == null) return null;
text = RemoveDiacritics(text).ToLower();
var ntext = string.Empty;
foreach(var c in text)
{
if (c >= 'a' && c <= 'z')
{
ntext += c;
}
}
return ntext;
}
}
}

View file

@ -48,7 +48,7 @@ namespace AideDeJeu.ViewModels
var filter = Filters.FirstOrDefault(f => f.Key.ToString().ToLower() == key.ToLower());
if (filter != null)
{
filter.Index = filter.KeyValues.FindIndex(kv => kv.Value.ToLower().Contains(val.ToLower()));
filter.Index = filter.KeyValues.FindIndex(kv => kv.Value.Simplify().Contains(val));
}
}