Esempio n. 1
0
 public FindAndReplaceEventArgs(string searchText, string replaceText, bool matchCase, bool matchWholeWord, FindAndReplaceMode findAndReplaceMode)
 {
     SearchText         = searchText;
     MatchCase          = matchCase;
     MatchWholeWord     = matchWholeWord;
     ReplaceText        = replaceText;
     FindAndReplaceMode = findAndReplaceMode;
 }
Esempio n. 2
0
 public FindAndReplaceEventArgs(string searchText, string replaceText, bool matchCase, bool matchWholeWord, bool useRegex, FindAndReplaceMode findAndReplaceMode, SearchDirection searchDirection = SearchDirection.Next)
 {
     SearchText         = searchText;
     MatchCase          = matchCase;
     MatchWholeWord     = matchWholeWord;
     ReplaceText        = replaceText;
     FindAndReplaceMode = findAndReplaceMode;
     UseRegex           = useRegex;
     SearchDirection    = searchDirection;
 }
        public void Focus(string searchString, FindAndReplaceMode mode)
        {
            if (_shouldUpdateSearchString && !string.IsNullOrEmpty(searchString)) FindBar.Text = searchString;

            if (mode == FindAndReplaceMode.FindOnly)
                FindBar.Focus(FocusState.Programmatic);
            else
                ReplaceBar.Focus(FocusState.Programmatic);

            FindBar_OnTextChanged(null, null);
        }
 public void Focus(FindAndReplaceMode mode)
 {
     if (mode == FindAndReplaceMode.FindOnly)
     {
         FindBar.Focus(FocusState.Programmatic);
     }
     else
     {
         ReplaceBar.Focus(FocusState.Programmatic);
     }
 }
Esempio n. 5
0
 public FindAndReplaceEventArgs(
     SearchContext searchContext,
     string replaceText,
     FindAndReplaceMode findAndReplaceMode,
     SearchDirection searchDirection = SearchDirection.Next)
 {
     SearchContext      = searchContext;
     ReplaceText        = replaceText;
     FindAndReplaceMode = findAndReplaceMode;
     SearchDirection    = searchDirection;
 }
Esempio n. 6
0
        public void findAndReplace(String find, String replacement, FindAndReplaceMode mode)
        {
            TextRange tr = new TextRange(Document.ContentStart, Document.ContentEnd);

            if (mode == FindAndReplaceMode.WholeWordsOnly)
            {
                tr.Text = tr.Text.Replace(" " + find + " ", " " + replacement + " ");
            }
            else
            {
                tr.Text = tr.Text.Replace(find, replacement);
            }
        }
Esempio n. 7
0
 public void Focus(FindAndReplaceMode mode)
 {
     if (mode == FindAndReplaceMode.FindOnly)
     {
         FindBar.Focus(FocusState.Programmatic);
     }
     else
     {
         if (!string.IsNullOrEmpty(FindBar.Text))
         {
             FindBar.SelectionStart = FindBar.Text.Length;
         }
         if (!string.IsNullOrEmpty(ReplaceBar.Text))
         {
             ReplaceBar.SelectionStart = ReplaceBar.Text.Length;
         }
         ReplaceBar.Focus(FocusState.Programmatic);
     }
 }