示例#1
0
        private void eventTerminated( object sender, EventArgs e)
        {
            lock (this)
            {
                if (timerThread != null && timerThread.IsAlive)
                {
                    timerThread.Abort();
                }
                if (controller != null)
                {
                    controller = null;
                }
                if (this.StartEventButton.InvokeRequired || stopEventButton.InvokeRequired )
                {
                    changeButtons d = new changeButtons(setButtonEnabled);
                    this.Invoke(d, new object[] { true, false, false });

                } else
                {
                    missileCount.Text = controller.numberOfMissiles.ToString();
                }
            }
        }
示例#2
0
        private void emergencyStop()
        {
            if (this.StartEventButton.InvokeRequired || stopEventButton.InvokeRequired)
            {
                changeButtons d = new changeButtons(setButtonEnabled);
                this.Invoke(d, new object[] { true, false, false });

            }
            else
            {
                setButtonEnabled(true, false, false);
            }
            if (timerThread != null && timerThread.IsAlive)
            {
                timerThread.Abort();
                timerThread = null;
            }
            if (controller != null)
            {
                controller.emergencyStop();
                controller = null;
            }
        }