David Smith

David Smith

  • NA
  • 2k
  • 0

XmlSerializer

Jul 5 2013 2:34 AM
         Below, I am using XmlSerializer write the object data out to xml file. In the object I have 8 elements worth of data. The serializer is only writing the last element to the file and not all the elements. Do you know why. when I look in the m_file, I see all the data I need. But all the data so not go to the file.

         // serialize
         XmlSerializer serializer = new XmlSerializer(typeof(DutyCycleTimes));
         TextWriter writer = new StreamWriter(fileName);
         serializer.Serialize(writer, file, null);
         writer.Close();

Answers (2)