mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 22:45:44 +00:00
Recherche multilingue
This commit is contained in:
parent
64fb8082de
commit
6882a31d12
3 changed files with 20 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
|
||||
namespace AideDeJeuLib
|
||||
|
|
@ -17,6 +18,15 @@ namespace AideDeJeuLib
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public string NameVO { get; set; }
|
||||
public string NameVOText
|
||||
{
|
||||
get
|
||||
{
|
||||
var regex = new Regex("\\[(?<text>.*?)\\]");
|
||||
var match = regex.Match(NameVO ?? string.Empty);
|
||||
return match.Groups["text"].Value;
|
||||
}
|
||||
}
|
||||
|
||||
public Properties Properties { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,10 @@ namespace AideDeJeu.ViewModels
|
|||
spell.Source.Contains(source) &&
|
||||
spell.Source.Contains(classe) &&
|
||||
spell.Rituel.Contains(rituel) &&
|
||||
Helpers.RemoveDiacritics(spell.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower());
|
||||
(
|
||||
(Helpers.RemoveDiacritics(spell.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||
(Helpers.RemoveDiacritics(spell.NameVOText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower()))
|
||||
);
|
||||
}).OrderBy(spell => spell.Name)
|
||||
.AsEnumerable();
|
||||
}, token);
|
||||
|
|
@ -379,7 +382,10 @@ namespace AideDeJeu.ViewModels
|
|||
monster.Source.Contains(source) &&
|
||||
powerComparer.Compare(monster.Challenge, minPower) >= 0 &&
|
||||
powerComparer.Compare(monster.Challenge, maxPower) <= 0 &&
|
||||
Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower());
|
||||
(
|
||||
(Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||
(Helpers.RemoveDiacritics(monster.NameVOText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower()))
|
||||
);
|
||||
})
|
||||
.OrderBy(monster => monster.Name)
|
||||
.AsEnumerable();
|
||||
|
|
|
|||
|
|
@ -45,8 +45,9 @@
|
|||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<StackLayout Padding="10">
|
||||
<StackLayout Padding="10" Orientation="Vertical">
|
||||
<Label Text="{Binding Name}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
|
||||
<Label Text="{Binding NameVOText}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="12" />
|
||||
</StackLayout>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue