Exemplo n.º 1
0
 /// <summary>
 /// Установить текущую главу по наименованию
 /// </summary>
 /// <param name="chapterCaption"></param>
 /// <param name="saveOnDisk"></param>
 public void SetCurrentChapterByCaption([NotNull] string chapterCaption, bool saveOnDisk)
 {
     RuntimeEnvironment.ChapterSelected = true;
     _currentChapter = Chapters.FirstOrDefault(x => x.Caption == chapterCaption) ?? Chapters.First();
     if (saveOnDisk)
     {
         Helpers.WriteDiscContent(TestsManager.CURRENT_CHAPTER_FILE, chapterCaption);
     }
 }
Exemplo n.º 2
0
 public void RemovePaddingChapters()
 {
     if (Chapters.FirstOrDefault()?.IsPaddingChapter ?? false)
     {
         Chapters.RemoveAt(0);
     }
     if (Chapters.LastOrDefault()?.IsPaddingChapter ?? false)
     {
         Chapters.RemoveAt(Chapters.Count - 1);
     }
 }
Exemplo n.º 3
0
        public Chapter GetChapterByTitle(string title)
        {
            Chapter chapter = Chapters.FirstOrDefault(c => c.Title == title);

            return(chapter);
        }
Exemplo n.º 4
0
        public Chapter GetChapterById(int id)
        {
            Chapter chapter = Chapters.FirstOrDefault(c => c.ID == id);

            return(chapter);
        }