Use attributes
This commit is contained in:
1 parent
e01bd5da81
commit
8ac2ab9a03
2 files changed
+7
-7
No files matched your search
@@ -6,9 +6,8 @@
|
|||||||
<Author>flokuep</Author>
|
<Author>flokuep</Author>
|
||||||
</Info>
|
</Info>
|
||||||
<!--Cover definitions when a category is missing a cover-->
|
<!--Cover definitions when a category is missing a cover-->
|
||||||
<CoverGenerator1>
|
<!--Possible types are: Default, Song, Artist, Letter, Edition, Genre, Language, Year, Decade, Date -->
|
||||||
<!--Possible types are: Default, Song, Artist, Letter, Edition, Genre, Language, Year, Decade, Date -->
|
<CoverGenerator1 Type="Default">
|
||||||
<Type>Default</Type>
|
|
||||||
<Text>
|
<Text>
|
||||||
<!--<Text>: Text to be shown, %TEXT% will be replaced by the category or song name-->
|
<!--<Text>: Text to be shown, %TEXT% will be replaced by the category or song name-->
|
||||||
<Text>%TEXT%</Text>
|
<Text>%TEXT%</Text>
|
||||||
@@ -25,8 +24,7 @@
|
|||||||
<R>1</R><G>1</G><B>1</B><A>0.8</A>
|
<R>1</R><G>1</G><B>1</B><A>0.8</A>
|
||||||
</Color>
|
</Color>
|
||||||
<!--<Margin>: Spacing of the text from the borders of the image in px-->
|
<!--<Margin>: Spacing of the text from the borders of the image in px-->
|
||||||
<Margin>
|
<Margin Default="24">
|
||||||
<Default>24</Default>
|
|
||||||
<Left>24</Left>
|
<Left>24</Left>
|
||||||
</Margin>
|
</Margin>
|
||||||
<!--<Indent>: Indentation of the text for multiple lines-->
|
<!--<Indent>: Indentation of the text for multiple lines-->
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ namespace VocaluxeLib.Xml
|
|||||||
{
|
{
|
||||||
el = new SMargin();
|
el = new SMargin();
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
bool defOk = TryGetIntValue(xPath + "/Default", ref el.Default);
|
string val;
|
||||||
|
bool defOk = GetAttribute(xPath, "Default", out val) && int.TryParse(val, out el.Default);
|
||||||
ok &= TryGetIntValue(xPath + "/Left", ref el.Left, el.Default);
|
ok &= TryGetIntValue(xPath + "/Left", ref el.Left, el.Default);
|
||||||
ok &= TryGetIntValue(xPath + "/Right", ref el.Right, el.Default);
|
ok &= TryGetIntValue(xPath + "/Right", ref el.Right, el.Default);
|
||||||
ok &= TryGetIntValue(xPath + "/Top", ref el.Top, el.Default);
|
ok &= TryGetIntValue(xPath + "/Top", ref el.Top, el.Default);
|
||||||
@@ -89,7 +90,8 @@ namespace VocaluxeLib.Xml
|
|||||||
{
|
{
|
||||||
el = new SThemeCoverGenerator();
|
el = new SThemeCoverGenerator();
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
ok &= TryGetEnumValue(xPath + "/Type", ref el.Type);
|
string val;
|
||||||
|
ok &= GetAttribute(xPath, "Type", out val) && Enum.TryParse(val, out el.Type);
|
||||||
ok &= Read(xPath + "/Text", out el.Text);
|
ok &= Read(xPath + "/Text", out el.Text);
|
||||||
ok &= Read(xPath + "/BackgroundColor", out el.BackgroundColor);
|
ok &= Read(xPath + "/BackgroundColor", out el.BackgroundColor);
|
||||||
ok &= GetValue(xPath + "/Image", out el.Image);
|
ok &= GetValue(xPath + "/Image", out el.Image);
|
||||||
|
|||||||
Reference in new issue
Block a user