示例#1
0
文件: Form1.cs 项目: maoap1/grcis-1
        public void StopSimulation()
        {
            if (aThread == null)
            {
                return;
            }

            if (buttonSimulation.InvokeRequired)
            {
                StopSimulationCallback ea = new StopSimulationCallback(StopSimulation);
                BeginInvoke(ea);
            }
            else
            {
                // actually stop the rendering:
                lock ( progress )
                {
                    progress.Continue = false;
                }
                aThread.Join();
                aThread = null;

                // GUI stuff:
                SimModeGUI(false);
            }
        }
示例#2
0
文件: Form1.cs 项目: maoap1/grcis-1
        protected void StopSimulation()
        {
            if (sim == null ||
                aThread == null)
            {
                return;
            }

            if (buttonStart.InvokeRequired)
            {
                StopSimulationCallback ea = new StopSimulationCallback(StopSimulation);
                BeginInvoke(ea);
            }
            else
            {
                // actually stop the simulation thread:
                cont = false;
                aThread.Join();
                aThread = null;

                // GUI stuff:
                buttonStart.Enabled = true;
                buttonReset.Enabled = true;
                buttonStop.Enabled  = false;
            }
        }