##// END OF EJS Templates
Added SerializationHelpers.SerializeToFile method
cin -
r231:3eaa9372c754 v2
parent child
Show More
@@ -1,5 +1,6
1 using System;
1 using System;
2 using System.Collections.Generic;
2 using System.Collections.Generic;
3 using System.IO;
3 using System.Linq;
4 using System.Linq;
4 using System.Text;
5 using System.Text;
5 using System.Threading.Tasks;
6 using System.Threading.Tasks;
@@ -32,6 +33,11 namespace Implab.Xml {
32 return doc;
33 return doc;
33 }
34 }
34
35
36 public static void SerializeToFile<T>(string file, T obj) {
37 using (var writer = File.CreateText(file))
38 SerializersPool<T>.Instance.Serialize(writer, obj);
39 }
40
35 public static T DeserializeFromString<T>(string data) {
41 public static T DeserializeFromString<T>(string data) {
36 return SerializersPool<T>.Instance.DeserializeFromString(data);
42 return SerializersPool<T>.Instance.DeserializeFromString(data);
37 }
43 }
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved
author

ok, latest stable version should be in default

You need to be logged in to leave comments. Login now