예제 #1
0
        public void FindNext_AfterFailedFind()
        {
            CheckDisposed();

            m_testTeApp.ShowFindReplaceDialog(false, m_firstDraftView);
            FwFindReplaceDlg dlg = m_testTeApp.FindReplaceDialog;

            dlg.MatchNotFound += new FwFindReplaceDlg.MatchNotFoundHandler(FindDlgMatchNotFound);
            dlg.FindText       = MakeTSS("The will of the people");

            // make sure the initial find works
            m_noMatchFoundType = FwFindReplaceDlg.MatchType.NotSet;
            dlg.FindNext();
            Assert.AreEqual(FwFindReplaceDlg.MatchType.NoMatchFound,
                            m_noMatchFoundType);

            dlg.FindText = MakeTSS("jude");

            // make sure the search finds the first occurance (in the view) of Jude.
            dlg.FindNext();
            Assert.AreEqual(2, m_firstDraftView.TeEditingHelper.BookIndex);
            Assert.AreEqual(-1, m_firstDraftView.TeEditingHelper.SectionIndex);
            Assert.AreEqual(0, m_firstDraftView.ParagraphIndex);
            Assert.AreEqual(16, m_firstDraftView.SelectionAnchorIndex);
            Assert.AreEqual(20, m_firstDraftView.SelectionEndIndex);
        }
예제 #2
0
        public void FindNext_NoMatchesFound()
        {
            CheckDisposed();

            m_testTeApp.ShowFindReplaceDialog(false, m_firstDraftView);
            FwFindReplaceDlg dlg = m_testTeApp.FindReplaceDialog;

            dlg.MatchNotFound += new FwFindReplaceDlg.MatchNotFoundHandler(FindDlgMatchNotFound);
            dlg.FindText       = MakeTSS("The will of the people");

            // make sure the initial find works
            m_noMatchFoundType = FwFindReplaceDlg.MatchType.NotSet;
            dlg.FindNext();
            Assert.AreEqual(FwFindReplaceDlg.MatchType.NoMatchFound,
                            m_noMatchFoundType);
        }
예제 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="defaultMsg"></param>
		/// <param name="noMatchFoundType"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		private bool FindDlgMatchNotFound(object sender, string defaultMsg,
			FwFindReplaceDlg.MatchType noMatchFoundType)
		{
			m_noMatchFoundType = noMatchFoundType;
			return false;
		}
예제 #4
0
		public void FindNext_AfterFailedFind()
		{
			m_testTeApp.ShowFindReplaceDialog(false, m_firstDraftView);
			FwFindReplaceDlg dlg = m_testTeApp.FindReplaceDialog;

			dlg.MatchNotFound += new FwFindReplaceDlg.MatchNotFoundHandler(FindDlgMatchNotFound);
			dlg.FindText = MakeTSS("The will of the people");

			// make sure the initial find works
			m_noMatchFoundType = FwFindReplaceDlg.MatchType.NotSet;
			dlg.FindNext();
			Assert.AreEqual(FwFindReplaceDlg.MatchType.NoMatchFound,
				m_noMatchFoundType);

			dlg.FindText = MakeTSS("jude");

			// make sure the search finds the first occurance (in the view) of Jude.
			dlg.FindNext();
			Assert.AreEqual(2, m_firstDraftView.TeEditingHelper.BookIndex);
			Assert.AreEqual(-1, m_firstDraftView.TeEditingHelper.SectionIndex);
			Assert.AreEqual(0, m_firstDraftView.ParagraphIndex);
			Assert.AreEqual(16, m_firstDraftView.SelectionAnchorIndex);
			Assert.AreEqual(20, m_firstDraftView.SelectionEndIndex);
		}
예제 #5
0
		public void FindNext_NoMatchesFound()
		{
			m_testTeApp.ShowFindReplaceDialog(false, m_firstDraftView);
			FwFindReplaceDlg dlg = m_testTeApp.FindReplaceDialog;

			dlg.MatchNotFound += new FwFindReplaceDlg.MatchNotFoundHandler(FindDlgMatchNotFound);
			dlg.FindText = MakeTSS("The will of the people");

			// make sure the initial find works
			m_noMatchFoundType = FwFindReplaceDlg.MatchType.NotSet;
			dlg.FindNext();
			Assert.AreEqual(FwFindReplaceDlg.MatchType.NoMatchFound,
				m_noMatchFoundType);
		}
예제 #6
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// This is used to prevent displaying a Message box when no match is found
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="defaultMsg"></param>
 /// <param name="noMatchFoundType"></param>
 /// <returns></returns>
 /// ------------------------------------------------------------------------------------
 private bool FindDlgMatchNotFound(object sender, string defaultMsg,
                                   FwFindReplaceDlg.MatchType noMatchFoundType)
 {
     m_noMatchFoundType = noMatchFoundType;
     return(false);
 }