示例#1
0
        public bool ParseInputFile()
        {
            try
            {
                _magazine = MagazineType.LoadFromFile(_inputFile);

                if (_magazine == null)
                {
                    Console.Error.WriteLine("Erreur lors de la lecture du fichier d'entré");
                    return(false);
                }
                else
                {
                    if (_magazine.Couverture != null && _magazine.Couverture.Articles != null)
                    {
                        for (int i = 0; i < _magazine.Couverture.Articles.Count; ++i)
                        {
                            string      articleRef = _magazine.Couverture.Articles[i].Ref;
                            ArticleType article    = _magazine.GetArticleByID(articleRef);
                            _magazine.Couverture.Articles[i] = article;
                        }
                    }

                    return(true);
                }
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.FullTrace());
                return(false);
            }
        }
示例#2
0
        private GeneratorEPub(Generator generator, MagazineType magazine)
        {
            string epubFileName = String.Format("mag{0}.epub", magazine.Numero);

            _outputZipFileName = Path.Combine(generator.RootDirectory.FullName, epubFileName);
            _generator         = generator;
            _magazine          = magazine;
        }
示例#3
0
 public static GeneratorEPub Create(Generator generator, MagazineType magazine)
 {
     return(new GeneratorEPub(generator, magazine));
 }