Ejemplo n.º 1
0
        protected void SaveOpfFixToFile()
        {
            List <string> list = new List <string>()
            {
                "metadata", "manifest", "spine", "guide"
            };
            OpfDocument doc = new OpfDocument();

            foreach (string item in list)
            {
                XElement meta = doc.GetXmlElement(item);
                if (meta != null)
                {
                    doc.ReplaceSection(meta, item);
                }
            }
        }
Ejemplo n.º 2
0
        public static void DeleteFromGuide(IEnumerable<string> FilesToDelete)
        {
            OpfDocument doc = new OpfDocument();
            XElement oldManifest = doc.GetXmlElement("guide");
            XNamespace ns = oldManifest.Name.Namespace;
            List<XElement> newItems = new List<XElement>();

            foreach (XElement item in oldManifest.Elements())
            {
                string href = item.Attribute("href").Value;
                if (!FilesToDelete.Contains(href))
                {
                    newItems.Add(item);
                }
            }

            XElement newManifest = new XElement(ns + "guide", newItems);
            doc.ReplaceSection(newManifest, "guide");
        }
Ejemplo n.º 3
0
        public static void DeleteFromGuide(IEnumerable <string> FilesToDelete)
        {
            OpfDocument     doc         = new OpfDocument();
            XElement        oldManifest = doc.GetXmlElement("guide");
            XNamespace      ns          = oldManifest.Name.Namespace;
            List <XElement> newItems    = new List <XElement>();

            foreach (XElement item in oldManifest.Elements())
            {
                string href = item.Attribute("href").Value;
                if (!FilesToDelete.Contains(href))
                {
                    newItems.Add(item);
                }
            }

            XElement newManifest = new XElement(ns + "guide", newItems);

            doc.ReplaceSection(newManifest, "guide");
        }
Ejemplo n.º 4
0
 protected void SaveOpfFixToFile()
 {
     List<string> list = new List<string>() { "metadata", "manifest", "spine", "guide" };
     OpfDocument doc = new OpfDocument();
     foreach (string item in list)
     {
         XElement meta = doc.GetXmlElement(item);
         if (meta != null)
         {
             doc.ReplaceSection(meta, item);
         }
     }
 }