# HG changeset patch # User cin # Date 1505945192 -10800 # Node ID 3eaa9372c75403ba69b0a023f114fc53176ff8ee # Parent 5f7a3e1d32b998a703539963ed4ed369b925bc6b Added SerializationHelpers.SerializeToFile method diff -r 5f7a3e1d32b9 -r 3eaa9372c754 Implab/Xml/SerializationHelpers.cs --- a/Implab/Xml/SerializationHelpers.cs Tue Sep 12 19:07:42 2017 +0300 +++ b/Implab/Xml/SerializationHelpers.cs Thu Sep 21 01:06:32 2017 +0300 @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -32,6 +33,11 @@ return doc; } + public static void SerializeToFile(string file, T obj) { + using (var writer = File.CreateText(file)) + SerializersPool.Instance.Serialize(writer, obj); + } + public static T DeserializeFromString(string data) { return SerializersPool.Instance.DeserializeFromString(data); }