Hi.
I need to save several XUnit on a xml file to save the "project".
For xml creation i use XmlSerializer Serialize to save / create the file. That works great
for read the xml file i use Deserialize
the problem is that Deserialize read all the varialbles fine except the XUnit that has very different values of the values on the xml file
Any help? Thanks
public static void SaveXML(string FilePath, Proyect CurrentProyect)
{
System.Xml.Serialization.XmlSerializer ToFile = new System.Xml.Serialization.XmlSerializer(CurrentProyect.GetType());
XmlTextWriter XmlWriter = new XmlTextWriter(new FileStream(FuncionesGenerales.ValidaNombre(FilePath), FileMode.Create), Encoding.Unicode);
XmlWriter writer = XmlWriter;
ToFile .Serialize(writer, CurrentProyect);
XmlWriter.WriteEndElement();
writer.Close();
}
create xml file (for XUnit) that´s correct
<TamanoCarta_X>
<Point>180</Point>
<Inch>2.5</Inch>
<Millimeter>63.5</Millimeter>
<Centimeter>6.35</Centimeter>
<Presentation>240</Presentation>
</TamanoCarta_X>
reading code
XmlSerializer ser = new XmlSerializer(typeof(CurrentProyect));
NewConfig = (ser.Deserialize(stm) as CurrentProyect);

Thanks