public void TestFind()
 {
     FindLineOptions o = new FindLineOptions("Woot", true, false);
     var f = new LineMatcher(o);
     var s = new List<Match>(f.Filter(files_in_files1));
     Assert.Equal(1, s.Count);
 }
Example #2
0
 public Finder(FindFileOptions fileOptions, FindLineOptions lineOptions)
 {
     this.fileOptions = fileOptions;
     this.lineOptions = lineOptions;
 }
Example #3
0
        private void RunFinderAsync(FindFileOptions fileOptions, FindLineOptions lineOptions)
        {
            var finder = new Finder(fileOptions, lineOptions);
            finder.FileScanned += OnFinderOnFileScanned;

            // Do the find in the background
            var b = new BackgroundWorker();
            b.DoWork += delegate { finder.Find(); };
            b.RunWorkerCompleted += delegate { SafeInvoke(WorkerFinished); };
            b.RunWorkerAsync();
        }
Example #4
0
        private void RunReplace()
        {
            SavePrefsToRegistry();
            SetButtonsEnabled(false);

            var fileOptions = new FindFileOptions(
                comboSearchPath.Text,
                Util.ParseSearchExtensions(comboSearchExtensions.Text),
                Util.SplitDirectoryExcludes(comboExcludeDirectories.Text));

            var lineOptions = new FindLineOptions(
                SearchText,
                checkMatchCase.Checked,
                checkUseRegex.Checked,
                comboReplaceWith.Text);

            RunFinderAsync(fileOptions, lineOptions);
        }
Example #5
0
 public LineMatcher(FindLineOptions options)
 {
     this.options = options;
 }