Пример #1
0
        /// <summary>
        /// Serialize xml
        /// </summary>
        /// <param name="file">Name file with path</param>
        public void Serialize(string file)
        {
            string cadenaXml = UtilSerializationXml.Serialize(ListBlock, false);

            //string path = Environment.CurrentDirectory;
            //file = Path.Combine(path, "listBlock.txt");
            File.WriteAllText(file, cadenaXml);
        }
Пример #2
0
 public void DeserializeJson(string file)
 {
     ListBlock = UtilSerializationXml.getObjectOffJson <List <Block> >(file);
 }
Пример #3
0
        /// <summary>
        /// serializacion utilizando json
        /// </summary>
        /// <param name="file"></param>
        public void SerializeJson(string file)
        {
            string cadjson = UtilSerializationXml.SerializeJson(ListBlock);

            File.WriteAllText(file, cadjson);
        }
Пример #4
0
 public void Deserialize(string file)
 {
     ListBlock = UtilSerializationXml.getObjectOfXml <List <Block> >(file, new Type[]
                                                                     { typeof(Block) });
 }