예제 #1
0
        /// <summary>
        ///		Carga los datos de un cómic
        /// </summary>
        internal ComicModel Load(string path, string fileName, bool loadFull)
        {
            ComicModel          comic           = new ComicModel(path);
            string              strFullFileName = System.IO.Path.Combine(path, fileName);
            ComicReaderMediator mediator        = new ComicReaderMediator();
            MLFile              fileML          = new LibMarkupLanguage.Services.XML.XMLParser().Load(strFullFileName);

            // Recorre los nodos
            if (fileML != null)
            {
                foreach (MLNode nodeML in fileML.Nodes)
                {
                    if (nodeML.Name == ComicRepositoryConstants.TagRoot)
                    {
                        // Obtiene el ancho y el alto
                        comic.Width  = nodeML.Attributes[ComicRepositoryConstants.TagWidth].Value.GetInt(1000);
                        comic.Height = nodeML.Attributes[ComicRepositoryConstants.TagHeight].Value.GetInt(1000);
                        // Asigna las propiedades básicas del cómic
                        comic.Title         = nodeML.Nodes[ComicRepositoryConstants.TagTitle].Value.TrimIgnoreNull();
                        comic.Summary       = nodeML.Nodes[ComicRepositoryConstants.TagSummary].Value.TrimIgnoreNull();
                        comic.ThumbFileName = nodeML.Nodes[ComicRepositoryConstants.TagThumbFileName].Value.TrimIgnoreNull();
                        // Obtiene los componentes del cómic
                        if (loadFull)
                        {
                            foreach (MLNode childML in nodeML.Nodes)
                            {
                                switch (childML.Name)
                                {
                                case ComicRepositoryConstants.TagInclude:
                                case ComicRepositoryConstants.TagResources:
                                    mediator.ResourcesRepository.LoadResources(path, childML, comic);
                                    break;

                                case ComicRepositoryConstants.TagPage:
                                    mediator.PagesRepository.LoadPage(childML, comic);
                                    break;
                                }
                            }
                        }
                        // Carga los idiomas (aunque no sea una carga completa)
                        LoadLanguage(comic, nodeML);
                    }
                }
            }
            // Devuelve el cómic cargado
            return(comic);
        }
 internal ComicShapesRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }
예제 #3
0
 internal ComicResourcesRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }
예제 #4
0
 internal ComicBrushesRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }
 internal ComicTimeLineRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }
 internal ComicPageRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }
예제 #7
0
 internal ComicTransformsRepository(ComicReaderMediator mediator)
 {
     Mediator = mediator;
 }