changeset 232:133ba4444acc v2

Слияние
author cin
date Thu, 21 Sep 2017 01:14:27 +0300
parents 3eaa9372c754 (diff) 3e26338eb977 (current diff)
children b49969a7043c
files Implab.mono.sln Implab/Formats/JSON/JsonElementContext.cs Implab/Formats/JSON/JsonElementType.cs Implab/Formats/JSON/JsonGrammar.cs Implab/Formats/JSON/JsonReader.cs Implab/Formats/JSON/JsonScanner.cs Implab/Formats/JSON/JsonStringScanner.cs Implab/Formats/JSON/JsonTextScanner.cs Implab/Formats/JSON/JsonTokenType.cs Implab/Formats/JSON/JsonWriter.cs Implab/Formats/JSON/StringTranslator.cs MonoPlay/MonoPlay.csproj MonoPlay/Program.cs MonoPlay/Properties/AssemblyInfo.cs MonoPlay/packages.config
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Implab/Xml/SerializationHelpers.cs	Wed Sep 13 16:55:13 2017 +0300
+++ b/Implab/Xml/SerializationHelpers.cs	Thu Sep 21 01:14:27 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<T>(string file, T obj) {
+            using (var writer = File.CreateText(file))
+                SerializersPool<T>.Instance.Serialize(writer, obj);
+        }
+
         public static T DeserializeFromString<T>(string data) {
             return SerializersPool<T>.Instance.DeserializeFromString(data);
         }