Exemplo n.º 1
0
        private static void GetConversationDialogModel(out MockConversationSearchTarget searchTarget, out IFindDialogModel findDialogModel)
        {
            searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = GetConversationRichTextBox();

            findDialogModel = new FindDialogModel(searchTarget);
        }
Exemplo n.º 2
0
        private int WordInstancesFoundReverse(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            int instancesFound = 0;

            int lastMatchIndex = int.MaxValue;

            while (model.LastQuerySuccessful)
            {
                model.Query = word;
                model.SearchDisplayedConversation(SearchDirection.Up);

                if (!model.LastQuerySuccessful || (searchTarget.MatchIndex > lastMatchIndex))
                {
                    break;
                }
                else
                {
                    lastMatchIndex = searchTarget.MatchIndex;
                }

                instancesFound++;
            }

            return(instancesFound);
        }
Exemplo n.º 3
0
        private int FindWordInStringHelper(string toFind, string target, SearchDirection direction, bool isCaseSensitive)
        {
            MockConversationSearchTarget searchTarget = new MockConversationSearchTarget();

            searchTarget.SearchTargetControl = CreateRichTextBoxWithContent(target);

            FindDialogModel_Accessor model = new FindDialogModel_Accessor(searchTarget);

            model.CaseSensitive = isCaseSensitive;

            return(model.FindWordInString(toFind, target, direction));
        }
Exemplo n.º 4
0
        private int WordInstancesFoundMatchCase(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            model.CaseSensitive = true;

            return(WordInstancesFound(model, searchTarget, word));
        }
Exemplo n.º 5
0
        private int WordInstancesFoundReverse(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            int instancesFound = 0;

            int lastMatchIndex = int.MaxValue;

            while (model.LastQuerySuccessful)
            {
                model.Query = word;
                model.SearchDisplayedConversation(SearchDirection.Up);

                if (!model.LastQuerySuccessful || (searchTarget.MatchIndex > lastMatchIndex))
                {
                    break;
                }
                else
                {
                    lastMatchIndex = searchTarget.MatchIndex;
                }

                instancesFound++;
            }

            return instancesFound;
        }
Exemplo n.º 6
0
        private int WordInstancesFoundMatchCase(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            model.CaseSensitive = true;

            return WordInstancesFound(model, searchTarget, word);
        }
Exemplo n.º 7
0
        private int FindWordInStringHelper(string toFind, string target, SearchDirection direction, bool isCaseSensitive)
        {
            MockConversationSearchTarget searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = CreateRichTextBoxWithContent(target);

            FindDialogModel_Accessor model = new FindDialogModel_Accessor(searchTarget);

            model.CaseSensitive = isCaseSensitive;

            return model.FindWordInString(toFind, target, direction);
        }
Exemplo n.º 8
0
        private static void GetSingleLineDialogModel(out MockConversationSearchTarget searchTarget, out IFindDialogModel findDialogModel)
        {
            searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = GetSingleLineRichTextBox();

            findDialogModel = new FindDialogModel(searchTarget);
        }