Exemple #1
0
        public void AddSpineEntry(FileInfo fileInfo)
        {
            var spine = content.SelectSingleNode("//opf:spine", contentNsmgr);
            var spineEntry = (XmlElement)content.CreateNode(XmlNodeType.Element, "itemref", contentNsmgr.LookupNamespace("opf"));
            spine.AppendChild(spineEntry);

            spineEntry.SetAttribute("idref", fileInfo.Id);
        }
Exemple #2
0
        public void AddFile(FileInfo fileInfo)
        {
            Files.Add(fileInfo);
            fileInfo.Id = string.Format("file{0}", ++fileCounter);

            var manifestNode = content.SelectSingleNode("//opf:manifest", contentNsmgr);
            var imageItem = (XmlElement) content.CreateNode(XmlNodeType.Element, "item", contentNsmgr.LookupNamespace("opf"));
            manifestNode.AppendChild(imageItem);
            imageItem.SetAttribute("href", fileInfo.NewPath);
            imageItem.SetAttribute("id", fileInfo.Id);
            imageItem.SetAttribute("media-type", fileInfo.MediaType);

            fileInfo.ContentNode = imageItem;
        }