예제 #1
0
 public void TestFind()
 {
     FindFileOptions o = new FindFileOptions(@"testfiles\files1", new string[] {}, new string[] {});
     var f = new FileMatcher(o);
     var r = new List<string>(f.Filter());
     Assert.Equal(3, r.Count);
 }
예제 #2
0
 public Finder(FindFileOptions fileOptions, FindLineOptions lineOptions)
 {
     this.fileOptions = fileOptions;
     this.lineOptions = lineOptions;
 }
예제 #3
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);
        }
예제 #4
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();
        }