コード例 #1
0
        static void Main(string[] args)
        {
            var options = new RegExTractorOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, options))
            {
                var workflow = new RegExTractorSimpleWorkflow();
                workflow.SingleFileCrawlFinished += workflow_SingleFileCrawlFinished;
                workflow.Process(options.Directory, options.Recursive, options.Filter, options.SearchTermInputFile, options.OutputFile, options.MaxThreads);
            }

            Console.WriteLine("Finished ... Press any key ...");
            Console.ReadKey();
        }
コード例 #2
0
        public ProgressDialog(string SearchDirectory, bool Recursive, string Filter, string SearchTermFile, string OutputFile, int MaxThreads)
        {
            InitializeComponent();
            searchDirectory = SearchDirectory;
            recursive       = Recursive;
            filter          = Filter;
            searchTermFile  = SearchTermFile;
            outputFile      = OutputFile;
            maxThreads      = MaxThreads;

            workflow = new RegExTractorSimpleWorkflow();
            workflow.SingleFileCrawlFinished += workflow_SingleFileCrawlFinished;

            backgroundWorker                            = new BackgroundWorker();
            backgroundWorker.DoWork                    += backgroundWorker_DoWork;
            backgroundWorker.RunWorkerCompleted        += backgroundWorker_RunWorkerCompleted;
            backgroundWorker.WorkerSupportsCancellation = true;

            if (!backgroundWorker.IsBusy)
            {
                backgroundWorker.RunWorkerAsync();
            }
        }