public FindAndReplaceEventArgs(string searchText, string replaceText, bool matchCase, bool matchWholeWord, FindAndReplaceMode findAndReplaceMode) { SearchText = searchText; MatchCase = matchCase; MatchWholeWord = matchWholeWord; ReplaceText = replaceText; FindAndReplaceMode = findAndReplaceMode; }
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); } }
public FindAndReplaceEventArgs( SearchContext searchContext, string replaceText, FindAndReplaceMode findAndReplaceMode, SearchDirection searchDirection = SearchDirection.Next) { SearchContext = searchContext; ReplaceText = replaceText; FindAndReplaceMode = findAndReplaceMode; SearchDirection = searchDirection; }
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); } }
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); } }