1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-23 18:43:27 +00:00

Refonte NameLevel

This commit is contained in:
Yan Maniez 2019-04-09 13:00:19 +02:00
parent 471d4c1636
commit 2f17832932
1756 changed files with 7259 additions and 7248 deletions

View file

@ -213,6 +213,13 @@ namespace AideDeJeu.ViewModels
return ParseItemProperties(source, item, table);
case ContainerBlock blocks:
return ParseItemProperties(source, item, blocks);
case HeadingBlock heading:
bool isnamee = ParseItemProperties(source, item, heading.Inline, heading);
if (isnamee)
{
//item.NameLevel = heading.Level;
}
return isnamee;
case LeafBlock leaf:
bool isname = ParseItemProperties(source, item, leaf.Inline);
if(isname)
@ -220,7 +227,7 @@ namespace AideDeJeu.ViewModels
if(leaf is HeadingBlock)
{
var headingBlock = leaf as HeadingBlock;
item.NameLevel = headingBlock.Level;
//item.NameLevel = headingBlock.Level;
}
}
return isname;
@ -238,7 +245,7 @@ namespace AideDeJeu.ViewModels
return isname;
}
public bool ParseItemProperties(string source, Item item, ContainerInline inlines)
public bool ParseItemProperties(string source, Item item, ContainerInline inlines, HeadingBlock headingBlock = null)
{
bool isname = false;
if (inlines == null)
@ -267,6 +274,10 @@ namespace AideDeJeu.ViewModels
if(propertyName == "Name")
{
isname = true;
if (headingBlock != null)
{
item.NameLevel = headingBlock.Level;
}
}
prop = item.GetType().GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance);
}