private void btnFilt_Click(object sender, RoutedEventArgs e) { startTime = DateTime.Now; threadList = new List <MythreadData>(); if (cbNo4Only.IsChecked == true) { no4Only(); return; } int count = 0; int i = 0; while (count < dataList.Count) { MythreadData thread = new MythreadData(this, ++i, new List <string>(dataList.GetRange(count, count + 25000 <= dataList.Count ? 25000 : dataList.Count - count)), tbNum.Text, tbChar.Text); threadList.Add(thread); Log(LogType.线程启动, "线程:" + i, dataList.Count, 0, thread.BlueList.Count); thread.Worker.RunWorkerAsync(thread); thread.Worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Worker_RunWorkerCompleted); count += thread.BlueList.Count; } }
void worker_DoWork(object sender, DoWorkEventArgs e) { MythreadData thread = e.Argument as MythreadData; thread.filterByRules(); }