I'm trying to serialize a list , with a few other classes - but its always serializing only data from the list, instead of other classes and attributes.
Suppose i have:
[Serializable]
public class JMF
{
[XmlElement("SenderID")]
public string SenderID { get; set; }
[XmlElement("Version")]
public string Version { get; set; }
}
[XmlType("InkZoneProfile")]
public class xmldata //Class to receive items list
{
[XmlIgnore]
public string xml_filename { get; set; }
[XmlAttribute("Separation")]
public string colorname { get; set; }
[XmlAttribute("ZoneSettingsX")]
public string colorvalues { get; set; }
}
And serialize command:
XmlSerializer serializer = new XmlSerializer(typeof(List
serializer.Serialize(Console.Out, xmlDataOfThisFile);
He's adding only the InkZoneProfile stuff - ignoring the JMF.
pastebin.com/KxHfiah3 - entire code is here. Just paste into a new project. Also on this link:drive.google.com/open?id=0BwU9_GrFRYrTT0ZTS2dRMUhIWms - there's a sample file - just make a copy of it for reading multiple files |
If so how do i fix it ?