public CollectionCarnet Charger()
        {
            CollectionCarnet list = null;

            if (flux.Length != 0)
            {
                list = ser.ReadObject(flux) as CollectionCarnet;
                flux.Close();
            }

            return(list);
        }
        public MainWindow()
        {
            InitializeComponent();
            CollectionDataXml chargeur = new CollectionDataXml("Données.xml");

            this.collections = chargeur.Charger();
            if (collections == null)
            {
                this.collections = new CollectionCarnet();
            }


            this.GestionAccuiel();
            if (carnet != null)
            {
                this.AfficherListeSemestre();
                this.labTitreCarnet.Content = "Carnet de " + this.carnet.Etudiant.Prenom + " " + this.carnet.Etudiant.Nom;
            }
            else
            {
                this.Close();
            }
        }
 public void Sauver(CollectionCarnet c)
 {
     ser.WriteObject(flux, c);
     flux.Close();
 }