示例#1
0
        private void SearchCommandExe()
        {
            var bw = new BackgroundWorker();

            bw.WorkerSupportsCancellation = true;
            bw.WorkerReportsProgress      = true;
            bw.DoWork             += Bw_DoWork;
            bw.ProgressChanged    += Bw_ProgressChanged;
            bw.RunWorkerCompleted += Bw_RunWorkerCompleted;
            bw.RunWorkerAsync(this);
            bw.RunWorkerCompleted += (sender, args) =>
            {
                ResultProperty.Clear();
                for (int i = 0; i < Result.Count; i++)
                {
                    ResultProperty.Add(Result[i]);
                }
                Cancel  = false;
                Replace = false;
            };
        }