/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ protected override void CreateTestData() { Cache.MapType(typeof(ChkRef), typeof(KeyTermRef)); // Create a word form inventory for the language project Cache.LangProject.WordformInventoryOA = new WordformInventory(); // create a book with some scripture data in it m_book = m_scrInMemoryCache.AddBookToMockedScripture(40, "Matthew"); IScrSection section = m_scrInMemoryCache.AddSectionToMockedBook(m_book.Hvo); m_scrInMemoryCache.AddSectionHeadParaToSection(section.Hvo, "Section Heading Text", ScrStyleNames.SectionHead); StTxtPara para = m_scrInMemoryCache.AddParaToMockedSectionContent(section.Hvo, ScrStyleNames.NormalParagraph); m_scrInMemoryCache.AddRunToMockedPara(para, "1", ScrStyleNames.ChapterNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "1", ScrStyleNames.VerseNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "The beginning of Matthew has some words.", null); m_scrInMemoryCache.AddRunToMockedPara(para, "2", ScrStyleNames.VerseNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "Verse two has even more stuff in it with words. And the word possible.", null); m_scrInMemoryCache.AddRunToMockedPara(para, "3", ScrStyleNames.VerseNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "Verse three does not have the key term in it.", null); m_scrInMemoryCache.AddRunToMockedPara(para, "4", ScrStyleNames.VerseNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "Verse four has the word possible in it.", null); m_scrInMemoryCache.AddRunToMockedPara(para, "5", ScrStyleNames.VerseNumber); m_scrInMemoryCache.AddRunToMockedPara(para, "Verse five has the wrong word impossible in it.", null); section.AdjustReferences(); // Create a key term for the term "words" IChkTerm keyTermWords = CreateChkTerm("words"); // Create references of MAT 1:1, MAT 1:2, and MAT 1:3 for the key term "words" CreateChkRef(keyTermWords, 40001001); CreateChkRef(keyTermWords, 40001002); CreateChkRef(keyTermWords, 40001003); // Create a key term for the term "possible" IChkTerm keyTermPossible = CreateChkTerm("possible"); // Create references of MAT 1:2, MAT 1:4, and MAT 1:5 for the key term "possible" CreateChkRef(keyTermPossible, 40001002); CreateChkRef(keyTermPossible, 40001004); CreateChkRef(keyTermPossible, 40001005); // Create a draft form, draft view, and a key terms view. if (m_draftForm != null) m_draftForm.Dispose(); m_draftForm = new DummyDraftViewForm(Cache); m_draftForm.DeleteRegistryKey(); m_scr.RestartFootnoteSequence = true; // Create a key terms view ChecksDraftViewCreateInfo keyTermsCreateInfo = new ChecksDraftViewCreateInfo( "KeyTermsDraftView", true); m_ktVwWrapper = new DummyKeyTermsViewWrapper(m_draftForm, Cache, keyTermsCreateInfo, m_draftForm.SettingsKey); m_ktVwWrapper.DisplayUI = false; m_draftForm.Controls.Add(m_ktVwWrapper); // Fill in the renderings view with the Key Terms m_ktVwWrapper.Visible = true; ((ISelectableView)m_ktVwWrapper).ActivateView(); ((DummyDraftView)m_ktVwWrapper.DraftView).MakeRoot(); //m_keyTermsViewWrapper.RenderingsView.MakeRoot(); m_draftForm.Show(); m_draftView = m_draftForm.DraftView; m_draftView.Width = 20; m_draftView.Height = 20; m_draftView.CallOnLayout(); m_draftForm.Hide(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ protected override void CreateTestData() { // create a book with some scripture data in it m_book = AddBookToMockedScripture(40, "Matthew"); IScrSection section = AddSectionToMockedBook(m_book); AddSectionHeadParaToSection(section, "Section Heading Text", ScrStyleNames.SectionHead); IStTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph); AddRunToMockedPara(para, "1", ScrStyleNames.ChapterNumber); AddRunToMockedPara(para, "1", ScrStyleNames.VerseNumber); AddRunToMockedPara(para, "The beginning of Matthew has some words.", null); AddRunToMockedPara(para, "2", ScrStyleNames.VerseNumber); AddRunToMockedPara(para, "Verse two has even more stuff in it with words. And the word possible.", null); AddRunToMockedPara(para, "3", ScrStyleNames.VerseNumber); AddRunToMockedPara(para, "Verse three does not have the key term in it.", null); AddRunToMockedPara(para, "4", ScrStyleNames.VerseNumber); AddRunToMockedPara(para, "Verse four has the word possible in it.", null); AddRunToMockedPara(para, "5", ScrStyleNames.VerseNumber); AddRunToMockedPara(para, "Verse five has the wrong word impossible in it.", null); // Create a key term for the term "words" IChkTerm keyTermWords = CreateChkTerm("words"); // Create references of MAT 1:1, MAT 1:2, and MAT 1:3 for the key term "words" CreateChkRef(keyTermWords, 40001001); CreateChkRef(keyTermWords, 40001002); CreateChkRef(keyTermWords, 40001003); // Create a key term for the term "possible" IChkTerm keyTermPossible = CreateChkTerm("possible"); // Create references of MAT 1:2, MAT 1:4, and MAT 1:5 for the key term "possible" CreateChkRef(keyTermPossible, 40001002); CreateChkRef(keyTermPossible, 40001004); CreateChkRef(keyTermPossible, 40001005); // Create a draft form, draft view, and a key terms view. if (m_draftForm != null) m_draftForm.Dispose(); m_draftForm = new DummyDraftViewForm(Cache); m_draftForm.DeleteRegistryKey(); m_scr.RestartFootnoteSequence = true; // Create a key terms view DummyDraftViewProxy viewProxy = new DummyDraftViewProxy(Cache); m_ktVwWrapper = new DummyKeyTermsViewWrapper(m_draftForm, Cache, viewProxy, m_draftForm.SettingsKey); m_draftForm.Controls.Add(m_ktVwWrapper); // Fill in the renderings view with the Key Terms m_ktVwWrapper.Visible = true; ((ISelectableView)m_ktVwWrapper).ActivateView(); ((DummyDraftView)m_ktVwWrapper.DraftView).MakeRoot(); //m_keyTermsViewWrapper.RenderingsView.MakeRoot(); #if __MonoCS__ // For Mono WinForms, calling Form.Show is unreliable without a main Application loop. // This will not change. See https://bugzilla.novell.com/show_bug.cgi?id=495562 m_draftForm.CreateControl(); m_miAfterSelect = m_ktVwWrapper.GetType().GetMethod("ktTree_AfterSelect", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, new Type[] {typeof(object), typeof(TreeViewEventArgs)}, null); #else m_draftForm.Show(); #endif m_draftView = (DummyDraftView)m_ktVwWrapper.DraftView; m_draftView.Width = 20; m_draftView.Height = 20; m_draftView.CallOnLayout(); m_draftForm.Hide(); }