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); }
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); }
/// ------------------------------------------------------------------------------------ /// <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; }
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); }
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); }
/// ------------------------------------------------------------------------------------ /// <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); }