Ejemplo n.º 1
0
        private ResourceType GetResourceTypeByBookAccessory(BookAccessory file)
        {
            switch (file.Type)
            {
            case AccessoryType.Content:
                return(ResourceType.Book);

            case AccessoryType.Cover:
                return(ResourceType.Image);

            case AccessoryType.Bibliography:
                return(ResourceType.BibliographyDocument);

            default:
                return(ResourceType.UnknownResourceFile);
            }
        }
Ejemplo n.º 2
0
        protected override void ProcessAttributes(BookVersion bookVersion, XmlReader xmlReader)
        {
            var position = bookVersion.Accessories.Count + 1;

            var typeString = xmlReader.GetAttribute("type");
            var fileName   = xmlReader.GetAttribute("name");

            if (string.IsNullOrEmpty(typeString) && m_log.IsFatalEnabled)
            {
                m_log.ErrorFormat("Metadata_processor : Accessory in position {0} does not have type attribute", position);
            }

            var type = GetTypeByTypeString(typeString);


            var accessory = new BookAccessory
            {
                FileName    = fileName,
                BookVersion = bookVersion,
                Type        = type
            };

            bookVersion.Accessories.Add(accessory);
        }