ow
This commit is contained in:
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user