1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| /**
* Salon
*/
public class CSalon
{
public void addRangee(CRangee rangee)
{
//....
}
[XmlArrayItem(typeof(CRangee), ElementName = "rangee")]
public CRangee []rangees; //référence vers les rangées du salon
}
/**
* Liste des salons
*/
public class CSalonManager
{
public static void save()
{
TextWriter w = new StreamWriter("save.xml");
XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(CSalonManager));
CSalonManager lesSalons = new CSalonManager();
x.Serialize(w, lesSalons);
w.Close();
}
[XmlArrayItem(typeof(CSalon), ElementName = "lesSalons")]
public static CSalon[] salons;
}
} |
Partager