Exemplo n.º 1
0
        /// <summary>
        /// PErmet d'inserez des livres dans la liseuse
        /// </summary>
        /// <param name="livres"></param>
        /// <returns>Renvoie les livres qui ne sont pas entré dans la liseuse</returns>
        public string[] ExportLivre(Livres[] livres)
        {
            FRM_LoadingLiseuse ll = new FRM_LoadingLiseuse(livres.Length);

            ll.Phrase = "Envoie des livres vers la liseuse";
            List <string> tmp = new List <string>();

            try
            {
                ll.Show();
                foreach (Livres livre in livres)
                {
                    _isbusy = true;
                    try
                    {
                        File.Copy(livre.full_chemin_livre, Lecteur.ToString() + @":\" + livre.FileName);
                        MessageBox.Show("fait");
                    }
                    catch (Exception e)
                    {
                        tmp.Add(livre.titre);
                        ExceptionHandler.ExeptionCatch(e);
                    }
                    ll.pas();
                }
                ll.Close();
                _isbusy = false;
            }
            catch (Exception e)
            {
                _isbusy = false;
                ExceptionHandler.ExeptionCatch(e);
            }
            return(tmp.ToArray());
        }
Exemplo n.º 2
0
 /// <summary>
 /// Retourne le chemin vers la DB de la liseuse
 /// </summary>
 /// <returns></returns>
 private string PATHTODB()
 {
     return(Lecteur.ToString() + pathtodb);
 }