Improvement to navigation regions

This commit is contained in:
TheXamlGuy
2024-05-09 22:37:36 +01:00
parent 711353c8e9
commit 54d2b5374d
31 changed files with 173 additions and 184 deletions
@@ -2,39 +2,41 @@
internal class PersonPictureInitialsGenerator
{
public static PersonPictureCharacterType GetCharacterType(string str)
public static PersonPictureCharacterType GetCharacterType(string content)
{
PersonPictureCharacterType result = PersonPictureCharacterType.Other;
for (int i = 0; i < 3; i++)
if (content is { Length: > 0 })
{
if ((i >= str.Length) || (str[i] == '\0') || (str[i] == 0xFEFF))
for (int i = 0; i < 3; i++)
{
break;
}
if ((i >= content.Length) || (content[i] == '\0') || (content[i] == 0xFEFF))
{
break;
}
char character = str[i];
PersonPictureCharacterType evaluationResult = GetCharacterType(character);
char character = content[i];
PersonPictureCharacterType evaluationResult = GetCharacterType(character);
switch (evaluationResult)
{
case PersonPictureCharacterType.Glyph:
result = PersonPictureCharacterType.Glyph;
break;
case PersonPictureCharacterType.Symbolic:
if (result != PersonPictureCharacterType.Glyph)
{
result = PersonPictureCharacterType.Symbolic;
}
break;
case PersonPictureCharacterType.Standard:
if ((result != PersonPictureCharacterType.Glyph) && (result != PersonPictureCharacterType.Symbolic))
{
result = PersonPictureCharacterType.Standard;
}
break;
default:
break;
switch (evaluationResult)
{
case PersonPictureCharacterType.Glyph:
result = PersonPictureCharacterType.Glyph;
break;
case PersonPictureCharacterType.Symbolic:
if (result != PersonPictureCharacterType.Glyph)
{
result = PersonPictureCharacterType.Symbolic;
}
break;
case PersonPictureCharacterType.Standard:
if ((result != PersonPictureCharacterType.Glyph) && (result != PersonPictureCharacterType.Symbolic))
{
result = PersonPictureCharacterType.Standard;
}
break;
default:
break;
}
}
}
return result;