예제 #1
0
파일: Form1.cs 프로젝트: NDChen/MyDemoCode
        public Form1()
        {
            InitializeComponent();

            _bgWorker = new BackgroundWorker();
            _bgWorker.WorkerReportsProgress = true;
            _bgWorker.DoWork += _bgWorker_DoWork;
            _bgWorker.ProgressChanged += _bgWorker_ProgressChanged;
            _bgWorker.RunWorkerCompleted += _bgWorker_RunWorkerCompleted;

            _indexHelper = new IndexHelper(Config.IndexFolder, Config.TextFilesFolder);
            _indexHelper.HasLog += ShowLog;
            _indexHelper.OnProgressChanged += (percent) => {
                _bgWorker.ReportProgress(percent);
            };

            _searchHelper = new SearchHelper(Config.IndexFolder);
            _searchHelper.HasLog += ShowLog;
        }
예제 #2
0
 public static void CreateIndex(this IndexHelper indexHelper)
 {
     indexHelper.CreateIndex(new PanGuAnalyzer());
 }