This commit is contained in:
owenchen committed 2026-08-19 14:11:17 +08:00
commit f05d2d215f
678 files changed
+73865

No files matched your search

@@ -0,0 +1,20 @@
using System.Xml.Serialization;
namespace CloudBuilder.Util
{
public class DeserializeHelper<T>
{
public static T Deserialize(string xml)
{
StringReader textReader = new StringReader(xml);
XmlSerializer serializer = new XmlSerializer(typeof(T));
return (T)serializer.Deserialize(textReader);
}
public static string LoadXml(string filePath)
{
if (!File.Exists(filePath)) return null;
return File.ReadAllText(Path.Combine(filePath));
}
}
}