Ejemplo n.º 1
0
        /// <summary>
        /// Lecture du fichier du concours contenant des informations sur les participants
        /// </summary>
        public void LectureDuFichier()
        {
            ViderLaListe();
            MettreLesCompteurÀZéro();
            string ligne;

            try
            {
                StreamReader lecture = new StreamReader(CHEMIN_DES_FICHIERS + NomFichier);
                while (!lecture.EndOfStream)
                {
                    ligne = lecture.ReadLine();
                    string[] tableau            = ligne.Split(';');
                    Artiste  nouveauParticipant = Instancier(tableau);
                    if (nouveauParticipant != null)
                    {
                        ListeParticipants.Add(nouveauParticipant);
                    }
                }

                // Fermeture du fichier
                lecture.Close();
            }
            catch { }
        }
Ejemplo n.º 2
0
 //Méthodes
 public void AjoutParticipant(Personne P, string role)
 {
     ListeParticipants.Add(Tuple.Create(P, role));
 }