Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Helper method for verifying a ScrVerse.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private static void VerifyScrVerse(ScrVerse scrVerse, StTxtPara para, int startRef, int endRef,
			string verseText, int iVerseStart, bool fIsChapter, bool fIsHeading, int iSection)
		{
			Assert.AreEqual(para.Hvo, scrVerse.HvoPara);
			Assert.AreEqual(startRef, scrVerse.StartRef);
			Assert.AreEqual(endRef, scrVerse.EndRef);
			Assert.AreEqual(verseText, scrVerse.Text.Text);
			Assert.AreEqual(iVerseStart, scrVerse.VerseStartIndex);
			Assert.AreEqual(fIsChapter, scrVerse.ChapterNumberRun);
			// check the ParaNodeMap too
			Assert.AreEqual((int)ScrBook.ScrBookTags.kflidSections, scrVerse.ParaNodeMap.BookFlid);
			Assert.AreEqual(iSection, scrVerse.ParaNodeMap.SectionIndex);
			Assert.AreEqual(fIsHeading ? (int)ScrSection.ScrSectionTags.kflidHeading :
				(int)ScrSection.ScrSectionTags.kflidContent, scrVerse.ParaNodeMap.SectionFlid);
			Assert.AreEqual(0, scrVerse.ParaNodeMap.ParaIndex);
			ParaNodeMap map = new ParaNodeMap(para);
			Assert.IsTrue(map.Equals(scrVerse.ParaNodeMap));
		}
Example #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Creates a deep copy of this ParaNodeMap
		/// </summary>
		/// <returns>The copy</returns>
		/// ------------------------------------------------------------------------------------
		public ParaNodeMap Clone()
		{
			ParaNodeMap clonedMap = new ParaNodeMap();
			clonedMap.m_location = (int[])this.m_location.Clone(); // int[].Clone may only return its reference
			return clonedMap;
		}