I have a class that contains several string and integer fields. I can serialize this fine using XmlSerializer.
Now I've added an object array as a field to my class (the object being a user defined class)
My question is how can i have the parent class serialize the object array as well?
here's a dummy example. Pretend like i can serialize an instance of the Settings class, except it won't serialize the ItemData[] array inside it. How can i serialize ItemData[] as well
Code:[System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:xmlns:CrReport:settings")] [System.Xml.Serialization.XmlRootAttribute("settings", Namespace = "urn:xmlns:app:settings", IsNullable = false)] Class Settings { public string filename; public int count; //How can i have it serialize this as well? public ItemData[] items; } class ItemData { public string title public int size; }




Reply With Quote