Avoid multiple comments in xml for array entries

This commit is contained in:
Flamefire committed 2014-12-22 22:47:58 +01:00
1 parent c64d7c5bab
commit cd4c010f99
2 files changed
+8 -1

No files matched your search

+7
View File
@@ -348,8 +348,14 @@ namespace Vocaluxe.Base
};
}
private static readonly List<string> _CommentsGot = new List<string>();
private static string _GetComment(string elName)
{
// Avoid multiple comments (e.g. for array entries)
if (_CommentsGot.Contains(elName))
return null;
_CommentsGot.Add(elName);
switch (elName)
{
case "DebugLevel":
@@ -467,6 +473,7 @@ namespace Vocaluxe.Base
public static void SaveConfig()
{
_CommentsGot.Clear();
var xml = new CXmlSerializer(true, _GetComment);
xml.Serialize(_FileConfig, Config);
}