コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);


        }