示例#1
0
        protected void StopAnimation()
        {
            if (aThread == null)
            {
                return;
            }

            if (buttonRenderAnim.InvokeRequired)
            {
                StopAnimationCallback ea = new StopAnimationCallback(StopAnimation);
                BeginInvoke(ea);
            }
            else
            {
                // actually stop the animation:
                lock ( progress )
                {
                    progress.Continue = false;
                }
                aThread.Join();
                aThread = null;

                // Dispose unwritten queued results:
                initQueue(0);
                semQueue   = null;
                semResults = null;

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

            if (buttonRenderAnim.InvokeRequired)
            {
                StopAnimationCallback ea = new StopAnimationCallback(StopAnimation);
                BeginInvoke(ea);
            }
            else
            {
                // actually stop the animation:
                lock ( progress )
                {
                    progress.Continue = false;
                }
                aThread.Join();
                aThread = null;

                // GUI stuff:
                SetGui(true);
            }
        }