Пример #1
0
 //结束任务
 public void TaskStop()
 {
     if (TaskState)
     {
         threadNewTask.Stop();
         threadUpadteTask.Stop();
         threadAssignTask.Stop();
         DataSync.Stop();
     }
 }
Пример #2
0
        //结束同步
        public static void Stop()
        {
            if (SyncState.Dbus)
            {
                dbusThread.Stop();
            }

            if (SyncState.ModbusTcp)
            {
                modbusThread.Stop();
            }
        }
Пример #3
0
 private void MDIParent1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (MessageBox.Show("真的要退出程序吗?", "退出程序", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
     {
         e.Cancel = true;
     }
     else
     {
         ConsoleThread.Stop();
         if (UdpSever.State)//如果服务器运行,则关闭服务器
         {
             UdpSever.Stop();
         }
         //关闭任务调度线程
         taskForm.TaskStop();
     }
 }
Пример #4
0
 private void DataMonitor_FormClosing(object sender, FormClosingEventArgs e)
 {
     mainThread.Stop();
 }