Load() public static method

public static Load ( System.Xml.Linq.XElement root ) : ChapterInfo
root System.Xml.Linq.XElement
return ChapterInfo
Exemplo n.º 1
0
        public static List <ChapterInfo> ReadPgcListFromFile(string file)
        {
            ChapterExtractor ex        = null;
            string           fileLower = file.ToLower();

            if (fileLower.EndsWith("txt"))
            {
                ex = new TextExtractor();
            }
            else if (fileLower.EndsWith("xpl"))
            {
                ex = new XplExtractor();
            }
            else if (fileLower.EndsWith("ifo"))
            {
                ex = new Ifo2Extractor();
            }
            else if (fileLower.EndsWith("mpls"))
            {
                ex = new MplsExtractor();
            }
            else if (fileLower.EndsWith("xml"))
            {
                throw new Exception("Format not yet supported.");
            }
            else if (fileLower.EndsWith("chapters"))
            {
                List <ChapterInfo> ret = new List <ChapterInfo>();
                ret.Add(ChapterInfo.Load(file));
                return(ret);
            }
            else
            {
                throw new Exception("The selected file is not a recognized format.");
            }

            return(ex.GetStreams(file));
        }
Exemplo n.º 2
0
        public static ChapterInfo Load(string filename)
        {
            XDocument doc = XDocument.Load(filename);

            return(ChapterInfo.Load(doc.Root));
        }
Exemplo n.º 3
0
        public static ChapterInfo Load(XmlReader r)
        {
            XDocument doc = XDocument.Load(r);

            return(ChapterInfo.Load(doc.Root));
        }