Change struct of cover file
This commit is contained in:
1 parent
6001f2f47d
commit
31a9ac6afa
5 files changed
+49
-23
No files matched your search
+27
-7
@@ -17,6 +17,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Drawing;
|
||||
@@ -28,8 +29,12 @@ namespace VocaluxeLib
|
||||
{
|
||||
public struct SMargin
|
||||
{
|
||||
public int Default;
|
||||
public int Left, Right, Top, Bottom;
|
||||
[XmlAttribute] public int Default;
|
||||
public int? Left, Right, Top, Bottom;
|
||||
[XmlIgnore] public bool LeftSpecified;
|
||||
[XmlIgnore] public bool RightSpecified;
|
||||
[XmlIgnore] public bool TopSpecified;
|
||||
[XmlIgnore] public bool BottomSpecified;
|
||||
}
|
||||
|
||||
public struct SThemeCoverGeneratorText
|
||||
@@ -43,12 +48,27 @@ namespace VocaluxeLib
|
||||
|
||||
public struct SThemeCoverGenerator
|
||||
{
|
||||
public ECoverGeneratorType Type;
|
||||
[XmlAttribute] public ECoverGeneratorType Type;
|
||||
public SThemeCoverGeneratorText Text;
|
||||
public SThemeColor BackgroundColor;
|
||||
public string Image;
|
||||
public float ImageAlpha;
|
||||
public bool ShowFirstCover;
|
||||
[XmlElement(IsNullable = true)] public string Image;
|
||||
[DefaultValue(0.5f)] public float ImageAlpha;
|
||||
[DefaultValue(false)] public bool ShowFirstCover;
|
||||
}
|
||||
|
||||
public struct SThemeCoverInfo
|
||||
{
|
||||
public string Name;
|
||||
public string Folder;
|
||||
[XmlElement(IsNullable = true)] public string Author;
|
||||
}
|
||||
|
||||
[XmlRoot("root")]
|
||||
public struct SThemeCover
|
||||
{
|
||||
[XmlIgnore] public string Name, Folder, FilePath;
|
||||
public SThemeCoverInfo Info;
|
||||
[XmlElement("CoverGenerator", IsNullable = false)] public List<SThemeCoverGenerator> CoverGenerators;
|
||||
}
|
||||
|
||||
public struct SInfo
|
||||
@@ -99,7 +119,7 @@ namespace VocaluxeLib
|
||||
[XmlRoot("Color")]
|
||||
public struct SThemeColor
|
||||
{
|
||||
[XmlAttribute] public string Name;
|
||||
[DefaultValue(null), XmlAttribute] public string Name;
|
||||
public float? R;
|
||||
public float? G;
|
||||
public float? B;
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace VocaluxeLib.Xml
|
||||
bool ok = true;
|
||||
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 + "/Top", ref el.Top, el.Default);
|
||||
ok &= TryGetIntValue(xPath + "/Bottom", ref el.Bottom, el.Default);
|
||||
ok &= TryGetIntValue(xPath + "/Bottom", ref el.Bottom, el.Default);*/
|
||||
return ok || defOk;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user