Let me describe the flow of my program first.
1. Deserialize data from xml file.
2. Addition of "PersonType" class to the AllPersonalData.
3. Serialize data back to the xml file.
My question is I have to use an array PersonType[] in the AllPersonalData class. But if I have to implement the "Addition of
PersonalType" (i.e. the step 2), I have to use ArrayList instead of a fixed length array. I know that I can use the ArrayList as an
intermediate, and then convert it to fixed length array when I do Serialization. But is there any alternative which is more direct?
Thanks.
The following are class declaration.
[System.Xml.Serialization.XmlRootAttribute("AllPers onalData", Namespace="", IsNullable=false)]
public class AllPersonalData {
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Pers on")]
public PersonType[] Person;
}
public class PersonType {
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Name;
}
--
My C++ and C# ( Traditional Chinese ) Web Site : www.franzwong.com/Home.php