Exemplo n.º 1
0
        private void OnAutoCollectButtonClick(object sender, EventArgs e)
        {
            AutoCollectAsync ac = new AutoCollectAsync();

            ac.StatuUpdate += StatuLabelUpdate;

            StatuLabel.Text           = string.Format("当前状态:自动采集已开启,下一次自动采集将于{0}启动,在此期间仍然可以手动进行采集。", General.Instance.UpdateCollectTime());
            General.Instance.prevTime = DateTime.Now;
            General.Instance.prevTime = General.Instance.prevTime.AddMilliseconds(Setting.Default.Interval);
            AutoCollectTimer.Interval = Setting.Default.Interval;
            AutoCollectTimer.Tag      = "Start";
            AutoCollectTimer.Start();
            StopCollectButton.Enabled = true;
            AutoCollectButton.Enabled = false;
        }
Exemplo n.º 2
0
 private void AccomplishCallBack()
 {
     if (InvokeRequired)
     {
         Invoke(new VoidDelegate(delegate()
         {
             StatuLabel.Text = string.Format("当前状态:自动采集已开启,下一次自动采集将于{0}启动,在此期间仍然可以手动进行采集。", General.Instance.UpdateCollectTime());
             CollectInfoListBox.Items.Add(string.Format("[{0}]: 第{1}次自动采集信息成功!共采集到{2}条信息。", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), General.Instance.collectCount, General.Instance.rooms.Count));
             CollectInfoListBox.SelectedIndex = CollectInfoListBox.Items.Count - 1;
             AutoCollectTimer.Start();
             AutoCollectTimer.Tag = "Start";
         }));
     }
     else
     {
         StatuLabel.Text = string.Format("当前状态:自动采集已开启,下一次自动采集将于{0}启动,在此期间仍然可以手动进行采集。", General.Instance.UpdateCollectTime());
         CollectInfoListBox.Items.Add(string.Format("[{0}]: 第{1}次自动采集信息成功!共采集到{2}条信息。", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), General.Instance.collectCount, General.Instance.rooms.Count));
         CollectInfoListBox.SelectedIndex = CollectInfoListBox.Items.Count - 1;
         AutoCollectTimer.Start();
         AutoCollectTimer.Tag = "Start";
     }
 }