Exemplo n.º 1
0
 private void OnStopCollectButtonClick(object sender, EventArgs e)
 {
     StatuLabel.Text = string.Format("当前状态:采集器已就绪,无自动采集任务。");
     if (autoCollectThread != null)
     {
         autoCollectThread.Abort();
     }
     AutoCollectTimer.Stop();
     AutoCollectTimer.Tag      = "Stop";
     StopCollectButton.Enabled = false;
     AutoCollectButton.Enabled = true;
 }
Exemplo n.º 2
0
        private void AutoCollectTimerTick(object sender, EventArgs e)
        {
            AutoCollectTimer.Stop();
            AutoCollectTimer.Tag = "Stop";
            StatuLabel.Text      = string.Format("当前状态:正在进行第{0}次自动采集。", ++General.Instance.collectCount);
            AutoCollectAsync ac = new AutoCollectAsync();

            ac.StatuUpdate += StatuLabelUpdate;
            ac.Accomplish  += AccomplishCallBack;

            autoCollectThread = new Thread(new ThreadStart(ac.Invoke));
            autoCollectThread.IsBackground = true;
            autoCollectThread.Start();
        }