Inheritance: SIL.FieldWorks.Common.Controls.SplitGridView.ViewProxy
コード例 #1
0
ファイル: KeyTermsTests.cs プロジェクト: bbriggs/FieldWorks
		/// ------------------------------------------------------------------------------------
		public DummyKeyTermsViewWrapper(Control parent, FdoCache cache, DummyDraftViewProxy createInfo,
			RegistryKey settingsRegKey) : base(parent, cache, createInfo, settingsRegKey, 0,
			string.Empty, null, null)
		{
		}
コード例 #2
0
ファイル: KeyTermsTests.cs プロジェクト: bbriggs/FieldWorks
		/// ------------------------------------------------------------------------------------
		/// <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();
		}