/// <summary> /// Gets the chosen text matchers for the query options. /// </summary> /// <param name="textToSearch">Text being searched.</param> /// <param name="findOptions">The chosen options.</param> /// <returns>Collection of matchers.</returns> public TextMatchers GetTextMatchers(string textToSearch, OptionsViewModel findOptions) { this.findOptions = findOptions; if (textMatchers == null) { textMatchers = CreateMatchers(); } for (int i = 0; i < textMatchers.Count; i++) { textMatchers[i].SetText(textToSearch); } return(textMatchers); }
/// <summary> /// Gets the chosen text matchers for the query options. /// </summary> /// <param name="textToSearch">Text being searched.</param> /// <param name="findOptions">The chosen options.</param> /// <returns>Collection of matchers.</returns> public TextMatchers GetTextMatchers(string textToSearch, OptionsViewModel findOptions) { this.findOptions = findOptions; if (textMatchers == null) textMatchers = CreateMatchers(); for (int i = 0; i < textMatchers.Count; i++) { textMatchers[i].SetText(textToSearch); } return textMatchers; }
/// <summary> /// New /// </summary> public RapidFindReplaceControlViewModel() { Query = new Keyoti.RapidFindReplace.WPF.Query("");//dont really understand this, but the query was persisting across form openings. QueryHistory = new ObservableBackwardsRingBuffer<string>(5); QueryHistoryCapacity = 5; FindOptions = new OptionsViewModel(); FindTextCommand = new ActionCommand(delegate() { FindText(FindScope/*, Query*/); }, () => true); SelectPreviousMatchCommand = new ActionCommand(delegate() { SelectPreviousMatch(); }, () => true); SelectNextMatchCommand = new ActionCommand(delegate() { SelectNextMatch(); }, () => true); ReplaceMatchCommand = new ActionCommand(delegate(string replacement) { ReplaceMatch(/*Query.ProcessReplacementSyntax(*/ replacement /*)*/); }, ()=>true); ReplaceAllMatchesCommand = new ActionCommand(delegate(string replacement) { ReplaceAllMatches(/*Query.ProcessReplacementSyntax(*/replacement/*)*/); }, () => true); }