예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a new ParaNodeMap containing the location information that
        /// can be extracted from this ScrVerse (namely whether it is in a title
        /// or section, what section is lives in, whether that section is a heading
        /// or content section, which paragraph it is within that section, and the character
        /// offset in the paragraph)
        /// </summary>
        /// <param name="verse">The given ScrVerse.</param>
        /// <param name="cache">The cache.</param>
        /// ------------------------------------------------------------------------------------
        public ParaNodeMap(ScrVerse verse, LcmCache cache)
        {
            // Get para containing the ScrVerse and
            ConstructFromPara(verse.Para);

            // Add character offset of ScrVerse
            m_location[kCharIndex] = verse.VerseStartIndex;
        }
예제 #2
0
        public void MoveNext_StanzaBreak()
        {
            IScrSection section   = AddSectionToMockedBook(m_genesis);
            IScrTxtPara emptyPara = AddEmptyPara(section, ScrStyleNames.StanzaBreak);

            // Create and iterate through the verses in the StText.
            using (ScrVerseSet verseSet = new ScrVerseSet(emptyPara))
            {
                Assert.IsTrue(verseSet.MoveNext());
                ScrVerse verse = verseSet.Current;
                Assert.IsTrue(verse.Text == null || string.IsNullOrEmpty(verse.Text.Text));
                Assert.AreEqual(ScrStyleNames.StanzaBreak, verse.Para.StyleName);
                Assert.AreEqual(01001001, verse.StartRef);
                Assert.AreEqual(01001001, verse.EndRef);
                Assert.IsFalse(verseSet.MoveNext());
            }
        }