Пример #1
0
        // Constructor
        public Chapter(Book book, Int32 chapId, Int32 chapNum, ChapterPreface preface)
        {
            if(book == null)
                throw new ArgumentNullException("book");

            _book = book;
            _chapId = chapId;
            _chapNum = chapNum;
            _verses = new VerseCollection();
            _preface = preface;
            if(_preface != null)
                _preface.SetChapter(this);
        }
Пример #2
0
        private void SetupNewCurrentChapter(Int32 chap)
        {
            // Calculate chapter preface
            ChapterPreface preface;
            if (_preAccum != null)
            {
                preface = new ChapterPreface(_bible.GetNextVerseId(), _preAccum);
                _bible.NonVerses.Add(preface);
            }
            else
                preface = null;

            var chapObj = new Chapter(
                _curBook, _bible.GetNextChapterId(), chap, preface);
            _curChapter = chapObj;
            _curBook.Chapters.Add(chapObj);
            _preAccum = null;
        }