예제 #1
0
        private void CloseRuntimeControlWindow(SystemWindow runWindow)
        {
            runWindow.SendClose();
            bool bok = DelayCloseWindow("Startup");

            if (!bok)
            {
                throw new Exception("无法正常关闭!");
            }
            CloseQuestionWindow();
        }
예제 #2
0
        private bool DelayCloseWindow(string sName)
        {
            bool bClosed = false;

            for (int i = 0; i < 5; i++)
            {
                SleepALittle();
                SystemWindow win2Close = winOp.GetWindow(sName);
                if (win2Close != null)
                {
                    win2Close.SendClose();
                    bClosed = true;
                    break;
                }
            }
            return(bClosed);
        }
예제 #3
0
        public void Close()
        {
            StartMonitoring();
            SystemWindow selectionWindow = winOp.GetSelectionWindow();
            SystemWindow runWindow       = winOp.GetRuntimeControllerWindow();
            SystemWindow startUp         = winOp.GetStartupWindow();

            if (runWindow != null)
            {
                CloseRuntimeControlWindow(runWindow);
                return;
            }
            if (selectionWindow != null)
            {
                CloseSelectionWindow(selectionWindow);
                return;
            }
            if (startUp != null)
            {
                startUp.SendClose();
                CloseQuestionWindow();
                return;
            }
        }
예제 #4
0
 private void CloseSelectionWindow(SystemWindow selectionWindow)
 {
     selectionWindow.SendClose();
     CloseQuestionWindow();
 }