private void CloseRuntimeControlWindow(SystemWindow runWindow) { runWindow.SendClose(); bool bok = DelayCloseWindow("Startup"); if (!bok) { throw new Exception("无法正常关闭!"); } CloseQuestionWindow(); }
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); }
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; } }
private void CloseSelectionWindow(SystemWindow selectionWindow) { selectionWindow.SendClose(); CloseQuestionWindow(); }