コード例 #1
0
        private void btEnregistrer_Click(object sender, EventArgs e)
        {
            string  monTitre      = tbTitre.Text; //récupère info
            string  monInterprete = tbInterprète.Text;
            int     maDuree       = Convert.ToInt16(nudDurée.Text);
            Chanson maChanson     = new Chanson(); //Créé une Chanson

            maChanson.SetTitre(monTitre);
            maChanson.SetInterprete(monInterprete);
            maChanson.SetDuree(maDuree);
            MesOutils.EffacerZonesDeTexte(this);
            maPlaylist.AjouterChanson(maChanson); //Ajoute dans l'ArrayList
        }
コード例 #2
0
 //Méthodes spécifiques de cette classe
 public void AjouterChanson(Chanson uneChanson)
 {
     playlist.Add(uneChanson);
 }
コード例 #3
0
 //Mutateurs
 public void SetChanson(Chanson uneChanson)
 {
     chanson = uneChanson;
 }
コード例 #4
0
        /* Interface */

        // Récupérer objet serialisé
        public Playlist(SerializationInfo info, StreamingContext ctxt)
        {
            chanson  = (Chanson)info.GetValue("Chanson", typeof(Chanson));
            playlist = (List <Chanson>)info.GetValue("Playlist", typeof(List <Chanson>));
        }