Esempio n. 1
0
 public static Chapter Load(string folderName, string urlName, EdxLoadOptions options)
 {
     return(Load <Chapter>(folderName, "chapter", urlName, options, c =>
     {
         c.Sequentials = c.SequentialReferences.Select(x => Sequential.Load(folderName, x.UrlName, options)).ExceptNulls().ToArray();
         c.SequentialReferences = c.Sequentials.Select(v => v.GetReference()).ToArray();
     }));
 }
Esempio n. 2
0
 public static Chapter Load(string folderName, string urlName)
 {
     try
     {
         var chapter = new FileInfo(string.Format("{0}/chapter/{1}.xml", folderName, urlName)).DeserializeXml <Chapter>();
         chapter.UrlName     = urlName;
         chapter.Sequentials = chapter.SequentialReferences.Select(x => Sequential.Load(folderName, x.UrlName)).ToArray();
         return(chapter);
     }
     catch (Exception e)
     {
         throw new Exception(string.Format("Chapter {0} load error", urlName), e);
     }
 }