コード例 #1
0
        public ScriptBook(string title)
        {
            scriptText      = new Dictionary <ChapterTitle, List <List <ScriptParagraph> > >();
            chaptersOrdered = new Queue <ChapterTitle>();
            currentChapter  = new ChapterTitle("<no chapters added>", "<no subchapters added>");

            Title = title;
        }
コード例 #2
0
        private Dictionary <int, ChapterTitle> getChapters(NameValueCollection parserChapters)
        {
            Dictionary <int, ChapterTitle> chapters = new Dictionary <int, ChapterTitle>();
            int i = 1;

            foreach (string chapter in parserChapters)
            {
                var chapterParts = parserChapters[chapter].Split(';');
                var chapterTitle = new ChapterTitle(chapterParts[0], chapterParts[1]);

                chapters.Add(i++, chapterTitle);
            }

            return(chapters);
        }
コード例 #3
0
        internal void AddChapter(ChapterTitle chapter)
        {
            if (scriptText.ContainsKey(chapter))
            {
                throw new Exception("Chapter already exists!");
            }

            else
            {
                scriptText[chapter] = new List <List <ScriptParagraph> >();
                scriptText[chapter].Add(new List <ScriptParagraph>()); // initial section

                chaptersOrdered.Enqueue(chapter);
                currentChapter = chapter;
            }
        }