/// <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); }
public void DeserializeJson(string file) { ListBlock = UtilSerializationXml.getObjectOffJson <List <Block> >(file); }
/// <summary> /// serializacion utilizando json /// </summary> /// <param name="file"></param> public void SerializeJson(string file) { string cadjson = UtilSerializationXml.SerializeJson(ListBlock); File.WriteAllText(file, cadjson); }
public void Deserialize(string file) { ListBlock = UtilSerializationXml.getObjectOfXml <List <Block> >(file, new Type[] { typeof(Block) }); }