Rewrite Theme Engine
This commit is contained in:
1 parent
9e5011374f
commit
defb2ca6c7
116 files changed
+1034
-1020
No files matched your search
@@ -26,7 +26,7 @@ namespace VocaluxeLib.Xml
|
||||
private readonly XPathNavigator _Navigator;
|
||||
private readonly String _FilePath;
|
||||
|
||||
public string FilePath
|
||||
public override string FilePath
|
||||
{
|
||||
get { return _FilePath; }
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace VocaluxeLib.Xml
|
||||
{
|
||||
public abstract class CXmlDeserializer : CXmlReaderBase
|
||||
{
|
||||
public abstract string FilePath { get; }
|
||||
|
||||
public bool Read(string xPath, out SThemeFont el)
|
||||
{
|
||||
el = new SThemeFont();
|
||||
@@ -64,5 +66,32 @@ namespace VocaluxeLib.Xml
|
||||
TryGetBoolValue(xPath + "/ShowFirstCover", out el.ShowFirstCover);
|
||||
return ok;
|
||||
}
|
||||
|
||||
public bool Read(string xPath, out SInfo el)
|
||||
{
|
||||
el=new SInfo();
|
||||
bool ok = GetValue(xPath+"/Name", out el.Name);
|
||||
ok &= GetValue(xPath + "/Author", out el.Author);
|
||||
ok &= TryGetIntValue(xPath + "/VersionMajor", ref el.VersionMajor);
|
||||
ok &= TryGetIntValue(xPath + "/VersionMinor", ref el.VersionMinor);
|
||||
return ok;
|
||||
}
|
||||
|
||||
public bool CheckVersion(string xPath, int reqVersion)
|
||||
{
|
||||
int version=0;
|
||||
string errorMsg;
|
||||
if (!TryGetIntValue(xPath, ref version))
|
||||
errorMsg = "Version missing";
|
||||
else if (version != reqVersion)
|
||||
{
|
||||
errorMsg = version < reqVersion ? "the file ist outdated!" : "the file is for newer program versions!";
|
||||
errorMsg += " Current Version is " + reqVersion;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
CBase.Log.LogError("Cannot load "+FilePath+": "+errorMsg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user